Headers

Headers allow you to customize your emails regardless of the configuration of your account. For example you can add data according the recipient to customize content or use a specific sending domain. So the headers can fit your needs and each of your sent.

Choice your programming language
Your SMTP IDs

You will find your IDs in the 'Settings', 'SMTP & APIS' tab in the Tipimail application


Message sender

Complete informations about the sender

Message recipient

Complete informations about the recipient

Message content

Complete informations about the message

Headers

Enable headers you want to use in your code. The headers allow you to use some features such as adding custom data, replacement of variables, activation or not of tracking














Tracking




Tags

L'utilisation des tags par email est limité à 5 tags par emails. Pour chaque tag, une limite de 50 caractères alphanumérique est imposée.

Meta

 

 

 

Your code


			

You can now copy and paste this code and run your script to send your email.

The use of libraries simplifies writing code for sending email. They are for the most free and open-source. In the case of PHP, we recommend SwiftMailer. This library is one of the most popular and mostly efficient.
Start by installing SwiftMailer. You can perform this operation with Composer or make clone from Github account.
Include SwiftMailer in your development


					
						var nodemailer = require("nodemailer");
						
						var transport = nodemailer.createTransport({
							host: 'smtp.tipimail.com',
							port: 25,
							port: 587,
							auth: {
								user: '{{login_username}}',
								pass: '{{login_password}}'
							}
						});
						
						var mailOptions = {
							from: '{{sender_name}} <{{sender_email}}>',
							from: '{{sender_email}}',
							to: '{{recipient_name}} <{{recipient_email}}>',
							to: '{{recipient_email}}',
							html: "{{message_html}}",
							text: "{{message_text}}",
							subject: '{{message_subject}}',
							headers: [
								{key: "X-TM-TRACKING", value: '{{tracking}}'},
								{key: "X-TM-GOOGLEANALYTICS", value: '{{tracking_analytics}}'},
								{key: "X-TM-TAGS", value: '{{tags}}'},
								{key: "X-TM-BULK", value: '{{bulk}}'},
								{key: "X-TM-META", value: '{{meta}}'},
								{key: "X-TM-TEXTVERSION", value: '{{textversion}}'},
								{key: "X-TM-DOMAIN", value: '{{domain}}'},
							]
						};
						
						transport.sendMail(mailOptions, function(error, info) {
							if(error) {
								console.log(error);
							} else {
								console.log(info);
							}
						});
						
						transport.close();
					
						$username = "{{login_username}}";
						$password = "{{login_password}}";
						
						$transport = Swift_SmtpTransport::newInstance('smtp.tipimail.com', 25);
						$transport = Swift_SmtpTransport::newInstance('smtp.tipimail.com', 587, "tls");
						$transport->setUsername($username);
						$transport->setPassword($password);
						$swift = Swift_Mailer::newInstance($transport);
						
						$message_html = "{{message_html}}";
						$message_text = "{{message_text}}";
						$subject = "{{message_subject}}";
						$expediteur = array('{{sender_email}}' => '{{sender_name}}');
						$expediteur = array('{{sender_email}}');
						$destinataire = array('{{recipient_email}}' => '{{recipient_name}}');
						$destinataire = array('{{recipient_email}}');
						
						$message = new Swift_Message();
						$message->setSubject($subject)
							->setBody($message_html, 'text/html')
							->addPart($message_text, 'text/plain')
							->setFrom($expediteur)
							->setTo($destinataire);
						
						$headers = $message->getHeaders();
						$headers->addTextHeader('X-TM-TRACKING', '{{tracking}}');
						$headers->addTextHeader('X-TM-GOOGLEANALYTICS', '{{tracking_analytics}}');
						$headers->addTextHeader('X-TM-TAGS', '{{tags}}');
						$headers->addTextHeader('X-TM-BULK', '{{bulk}}');
						$headers->addTextHeader('X-TM-TEXTVERSION', '{{textversion}}');
						$headers->addTextHeader('X-TM-DOMAIN', '{{domain}}');
						$headers->addTextHeader('X-TM-META', '{{meta}}');
						
						if ($recipients = $swift->send($message, $failures)) {
							echo 'Message successfully sent!';
						} else {
							echo "There was an error:\n";
							print_r($failures);
						}
					
						import smtplib
						
						from email.mime.multipart import MIMEMultipart
						from email.mime.text import MIMEText
						msg = MIMEMultipart('mixed')
						
						msg['Subject'] = '{{message_subject}}'
						msg['From']    = '{{sender_email}}'
						msg['To']      = '{{recipient_email}}'
						
						msg['X-TM-TRACKING'] = '{{tracking}}'
						msg['X-TM-GOOGLEANALYTICS'] = '{{tracking_analytics}}'}
						msg['X-TM-TAGS'] = '[{{tags}}]'
						msg['X-TM-BULK'] = '{{bulk}}'
						msg['X-TM-TEXTVERSION'] = '{{textversion}}'
						msg['X-TM-DOMAIN'] = '{{domain}}'
						msg['X-TM-META'] = '{{meta}}'
						
						text = '{{message_text}}'
						html = '{{message_html}}'
						
						part1 = MIMEText(text, 'plain')
						part2 = MIMEText(html, 'html')
						
						username = '{{login_username}}'
						password = '{{login_password}}'
						
						msg.attach(part1)
						msg.attach(part2)
						
						s = smtplib.SMTP('smtp.tipimail.com', 25)
						
							s = smtplib.SMTP('smtp.tipimail.com', 587)
							s.starttls()
						
						
						s.login(username, password)
						
						try:
							s.sendmail(msg['From'], msg['To'], msg.as_string())
						finally:
							s.quit()
					
						require 'mail'
						
						Mail.defaults do
							delivery_method :smtp, {
								:port      => 25,
								:port      => 587,
								:address   => "smtp.tipimail.com",
								:user_name => "{{login_username}}",
								:password  => "{{login_password}}"
							}
						end
						
						mail = Mail.deliver do
							from    '{{sender_name}} <{{sender_email}}>'
							from    '{{sender_email}}'
							to      '{{recipient_name}} <{{recipient_email}}>'
							to      '{{recipient_email}}'
							subject '{{message_subject}}'
							
							headers({
								'X-TM-TRACKING' => '{{tracking}}',
								'X-TM-GOOGLEANALYTICS' => '{{tracking_analytics}}'},
								'X-TM-TAGS' => '[{{tags}}]',
								'X-TM-BULK' => '{{bulk}}',
								'X-TM-TEXTVERSION' => '{{textversion}}',
								'X-TM-DOMAIN' => '{{domain}}',
								'X-TM-META' => '{{meta}}',
							})
							
							text_part do
								body '{{message_text}}'
							end
							
							html_part do
								content_type 'text/html; charset=UTF-8'
								body '{{message_html}}'
							end
						end