Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.
Moderators: Chris Corbyn , General Moderators
Sephirangel
Forum Commoner
Posts: 45 Joined: Tue Jul 15, 2008 1:37 pm
Post
by Sephirangel » Mon May 18, 2009 5:07 pm
Hello all,
I have the following mail script;
Code: Select all
<?php
require_once('SwiftMailer/lib/swift_required.php');
$transport = Swift_SmtpTransport::newInstance('SMTP.blueyonder.co.uk', 25)
->setUsername('xxxxx')
->setPassword('xxxxx')
;
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('New Knitterbabes Sales')
->setFrom(array('xxxxxx' => 'xxxxx'))
->setTo(array('xxxxxxxx' => 'xxxxxx'))
->setBody("<b>TEST</b>")
;
$result = $mailer->send($message)
?>
My question is; how do i specify the email type? e.g. text/html so any HTML within the message gets rendered in the email (such as the <b> tags in the message)
thanks in advance!
Last edited by
Benjamin on Mon May 18, 2009 5:20 pm, edited 1 time in total.
Reason: Changed code type from text to php.
Benjamin
Site Administrator
Posts: 6935 Joined: Sun May 19, 2002 10:24 pm
Post
by Benjamin » Mon May 18, 2009 5:21 pm
Please reference the documentation on the swiftmailer website. Specifically there is documentation on sending multipart messages.
Sephirangel
Forum Commoner
Posts: 45 Joined: Tue Jul 15, 2008 1:37 pm
Post
by Sephirangel » Mon May 18, 2009 6:00 pm
I have had a look through the SwiftMailer documentation but I am still unsure how to specify header type using the code I have used.