Add image and hyperlink in auto response email (after form submission) -
i new php , building first project.
i creating auto response email sent user after form submission.
the auto response email need have content follows,
logo image
thank contacting us.
here can view our case study.(need link pdf file view**)
i manage text. not able add image , hyperlink. tried using variable store image url code visible instead of image. request if please guide me.to solve this.
<?php $to = $_post['email']; $from = "info@company.com"; $headers = "from: company"; $subject = "thank contacting us."; //$img='<img src="http://www.http://company.com/images/logo.jpg"/>'; $linkedin='linkedin'; $twitter='twitter'; $message= "dear ".$firstname." thank contacting us. here can view our case study. www.company.com/data/casestudy.pdf www.company.com | info@company.com | linkedin | twitter "; $mailsent = mail($to, $subject, $message, $headers); ?>
first, in $header add content type html
$headers .= "content-type:text/html;charset=utf-8";
http://php.net/manual/en/function.mail.php
this set mail content type html, can add tags , link of html without using variables, full code this
<?php $to = $_post['email']; $from = "info@company.com"; $headers = "from: company"; $headers .= "mime-version: 1.0" . "\r\n"; $headers .= "content-type:text/html;charset=utf-8" . "\r\n"; $subject = "thank contacting us."; $message="<img src='http://company.com/images/logo.jpg'/> <br/>dear ".$firstname." thank contacting us. here can view our case study. <a href='www.example.com'>file name </a> www.company.com | info@company.com |<a href='www.linkedin.com'>linkedin</a> |<a href='twitter.com'> twitter</a> "; $mailsent = mail($to, $subject, $message, $headers); ?>
and don't confused in single-quotes , double-quotes used here assume $firstname has value.
Comments
Post a Comment