Can't get embedding image to work in my mail

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

Can't get embedding image to work in my mail

Postby hebus » Wed Sep 08, 2010 6:48 am

I can't get embedding image to work in my code. (i want to embed : logo_mail.gif)
a second problem is that i always get 2 x mail .

Can sombody show me the way :)
This already works :

Syntax: [ Download ] [ Hide ]
//mail versturen

require_once 'mailer/swift_required.php';

//Compleet bericht     
<style type="text/css">
.style1 {color: #9191FF}
.style2 {font-size: 16px}
<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" bgcolor="#4faff6" >
<span class="style1">
 .headerTop { background-color:#0099FF; border-top:0px solid #000000; border-bottom:1px solid #FFFFFF; text-align:center; }
 .adminText { font-size:10px; color:#996600; line-height:200%; font-family:verdana; text-decoration:none; }
 .headerBar { background-color:#FFFFFF; border-top:0px solid #333333; border-bottom:10px solid #FFFFFF; }
 .title { font-size:20px; font-weight:bold; color:#CC6600; font-family:arial; line-height:110%; }
 .subTitle { font-size:11px; font-weight:normal; color:#666666; font-style:italic; font-family:arial; }
 .defaultText { font-size:12px; color:#000000; line-height:150%; font-family:trebuchet ms; }
 .footerRow { background-color:#FFFFCC; border-top:10px solid #FFFFFF; }
 .footerText { font-size:10px; color:#996600; line-height:100%; font-family:verdana; }
 a { color:#FF6600; color:#FF6600; color:#FF6600; }
<table width="100%" cellpadding="10" cellspacing="0" class="backgroundTable" bgcolor="#4faff6" >
<td valign="top" align="center">
<table width="550" cellpadding="0" cellspacing="0">
<td colspan="2" align="center" style="background-color:#FFCC66;border-top:0px solid #000000;border-bottom:1px solid #FFFFFF;text-align:center;"><span style="font-size:10px;color:#996600;line-height:200%;font-family:verdana;text-decoration:none;">Deze mail is automatich verzonden. Doe geen reply op deze mail.</a></span></td>
<td style="background-color:#FFFFFF;border-top:0px solid #333333;border-bottom:10px solid #FFFFFF;"><center>
  <a href=""></a>
  <span style="font-size:20px;font-weight:bold;color:#009900;font-family:arial;line-height:110%;"><span class="style2">'
<td style="background-color:#FFFFFF;border-top:0px solid #333333;border-bottom:10px solid #FFFFFF;"><a href=""><img src="logo_mail.gif"  width="24" border="0" align="center"></a></td>
<table width="550" cellpadding="20" cellspacing="0" bgcolor="#FFFFFF">
<td bgcolor="#FFFFFF" valign="top" style="font-size:12px;color:#000000;line-height:150%;font-family:trebuchet ms;">'
<td style="background-color:#99CC00;border-top:10px solid #FFFFFF;" valign="top">
  <p style="font-size:10px;color:#666666;line-height:100%;font-family:verdana;"> REYNAERTKRING DAKNAM v.z.w.
//Create the Transport
$transport = Swift_SmtpTransport::newInstance('******',*****)
$mailer = Swift_Mailer::newInstance($transport);
//Create the message
$message = Swift_Message::newInstance()
//Give the message a subject
//Set the From address with an associative array
->setFrom(array('*********' => 'Website Reynaertkringdaknam'))
//Set the To addresses with an associative array

//Give it a body
 ->setBody($body_compleet,'text/html', 'iso-8859-1');
        $result = $mailer->send($message);
        if (!$mailer->batchSend($message, $failures))
                echo "Failures:";

Forum Newbie
Posts: 1
Joined: Wed Sep 08, 2010 6:37 am

Return to Swift Mailer

Who is online

Users browsing this forum: No registered users and 1 guest