i wrote php routine not long ago send html email purposes of email verification.
in img tag using logo internet, followed "thank you, click button below verify email address." had trouble @ first, guys straightened me out on (sending html mail not working). when got answer, kicked myself not seeing myself.
using learned, tried similar on different project. time used image website's folder. not send. if took out image , put in old image, work. if put in both images, work. if took out old image, fail. if took out both of images, work. thinking might line length issue email server choking on (the local image had long file name, though path short), shortened name of image file. still failed. changed name of image file again few characters, , failed. seems new image cursed.
i'm having problems again different email. can't give full text of code without revealing client info should protected. going include can see i'm trying keep line lengths under 70 characters.
function sendverificationemail($email, $verificationcode) { $email2 = str_replace("@","%40",$email); $to = $email; $subject = 'aaaa bbbbb ccccc validation'; //text replaced protect client , maintain line lengths... $headers = "from: " . strip_tags('dddddd@eeee.org') . "\r\n"; $headers .= "reply-to: ". strip_tags('dddddd@eeee.org') . "\r\n"; $headers .= "cc: \r\n"; $headers .= "mime-version: 1.0\r\n"; $headers .= "content-type: text/html; charset=iso-8859-1\r\n"; $message = "<html><body>\r\n"; //$message .= "test#10<br>\r\n"; //$message .= "<img src='http://www.012345678901234.com/eeee/images/eeeelogo_short.png'>"; //$message .= "<img src='http://www.012345678901234.com/eeee/images/eeeelogo.png'>"; //$message .= '<img src="http://www.ffffffff.com/22221111004444/assets/images/logo.png"><br>'; $message .= "\r\n<h2>thank you!</h2>\r\n"; $message .= 'thank registering account gggg hhhhh iiiiii! '; $message .= 'please verify email address clicking button below.<br><br>'; $message .= '<a href="http://www.012345678901234.com/eeee/verifyemail.php?email='.$email2.'&code='.$verificationcode.'"><img src="http://www.012345678901234.com/images/verifyemail.png"></a>'; $message .= "</body></html>\r\n"; $message = wordwrap($message, 70, "\r\n"); mail($to, $subject, $message, $headers); }
the second , third items commented out problem images. suggest @ first?
sh
//$message .= "<img src='http://www.012345678901234.com/eeee/images/eeeelogo_short.png'>"; //$message .= "<img src='http://www.012345678901234.com/eeee/images/eeeelogo.png'>"; //$message .= '<img src="http://www.ffffffff.com/22221111004444/assets/images/logo.png"><br>';
if first works, why don't double quote second , third? , single quote img src.
like this:
//$message .= '<img src="http://www.012345678901234.com/eeee/images/eeeelogo_short.png">'; //$message .= '<img src="http://www.012345678901234.com/eeee/images/eeeelogo.png">'; //$message .= '<img src="http://www.ffffffff.com/22221111004444/assets/images/logo.png"><br>';
rest of code seems fine me (could wrong off course)