Jump to content

PHP send email with picture


iantooke

Recommended Posts

Hello,

 

I wonder if someone could help me out, I have a script which sends out an email but i really want to add a picture at the top (Company Logo etc) i have tried playing around with the code but it will not work?? Could anyone give me a pointer in the right direction

 

Many Thanks

 

/*Sending mail to customer*/
		$exp_dt_crt = explode(',',substr($out_date,0,-1));
		foreach($exp_dt_crt as $v)
		{
			$exp_dt_crt_n = explode('-',$v);
			$f_exp_date .= $exp_dt_crt_n[2].'/'.$exp_dt_crt_n[1].'/'.$exp_dt_crt_n[0].',';
		}
		$f_date = substr($f_exp_date,0,-1);

		$re=mysql_query("select * from `drivers` where `d_id`='$out_driver'")or die(mysql_error());
		$r_re=mysql_fetch_array($re);
		$drv_name = $r_re['d_name'];
		$drv_phone = $r_re['d_phone'];

		$to=$cust_email_add;
		$result9=mysql_query("select * from `mail_format` where `mail_id`='1'")or die(mysql_error());
		$result7=mysql_query("select * from `mail_format` where `mail_id`='10'")or die(mysql_error());
		$result8=mysql_query("select * from `mail_format` where `mail_id`='7'")or die(mysql_error());
		$r=mysql_fetch_array($result9);

		//echo 'customer<br/>';
		$subject='Outbound Booking Confirmation';
		$r1=mysql_fetch_array($result7);
		$r2=mysql_fetch_array($result8);

		$messagebody  ="<html><body><p>Below is confirmation of your booking with Travel.</p>";
		$messagebody .="<p><u><b>Booking Details</b></u><br></p>";
		$messagebody .='Hello, '.$cust_name_add."<br>"."<br>".
		'Booking type:- '.' Outbound'."<br>".
		/*'Booking date:- '. date('d/m/Y')."<br>".*/
		'Customer name:- '.$cust_name_add."<br>".
		'Departure date:- '.$f_date."<br>".
		'Pick up time:- '.$out_time_collection."<br>".
		'Terminal:- '.$out_terminal."<br>".
		'Pick up point:- '.$out_pick_add."<br>".
		'Drop off point:- '.$out_drop_add."<br>".
		'Number of passengers:- '.$out_people."<br>".
		'Additional Information:- '.$out_comment."<br>".
		'Price:- '.$out_price."<br>".
		'Driver Name:- '.$drv_name."<br>".
		'Driver Phone:- '.$drv_phone."<br>"."<br>".
		'Terms and Conditions:- '.$r1['mail_content'].'<br>'."<br>";
		$messagebody .="Thank you. <br></body></html>";

		$mailheaders = "From: Travel <bookings@travel.com> \n";
		$mailheaders .= 'MIME-Version: 1.0' . "\n";
		$mailheaders .= 'Content-type: text/html; charset=iso-8859-1' . "\n";

		set_time_limit(0);
		ignore_user_abort(true);
		$form = 'bookings@travel.com';

		$m = new dSendMail2;
		$mailid = $cust_email_add;
		//$mailid='test@gmail.com';
		$m->setTo($mailid);
		$m->setFrom($form);
		$m->setSubject($subject);
		$m->setMessage($messagebody);
		$m->send();

 

 

Link to comment
Share on other sites

Hello,

 

Yes i did try that two different ways, Unfortuntely both ways cause a Parse error: syntax error, unexpected T_STRING??  :(

 

$messagebody  ="<html><img src="http://www.domainname.co.uk/headerpic.jpg" width="462" height="229"><body><p>Below is confirmation of your booking with Travel.</p>";

 

$messagebody  ="<html><body><img src="http://www.domainname.co.uk/headerpic.jpg" width="462" height="229"><p>Below is confirmation of your booking with Travel.</p>";

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.