I have a script for sending HTML email messages which works fine for text and html tags but I cannot figure out why my images wont display.
function sendHtmlEmail($email, $content, $message_content){
$to = "$email";
$subject = "AeroBLOG - $content";
$message = "
<HTML>
<HEAD>
<TITLE>$subject</TITLE>
<META http-equiv='content-type' content='text/html; charset=utf-8' />
<STYLE>
</HEAD>
<BODY>
$message_content
</BODY>
</HTML>
";
$headers = "MIME-Version: 1.0
";
$headers .= "Content-type: text/html; charset: utf8
";
$headers .= 'From: <do-not-reply@aeroblog.tk>' . "
";
if(mail($to,$subject,$message,$headers)){return true;}else{return false;}
}
call to function:
$message="<A href=\"http://aeroblog.tk/\"><IMG src=\"http://aeroblog.tk/img/VerificationEmail.png\" alt=\"copy & paste this link into your browsers navigation bar: http://.........\" width=\"1024px\" height=\"768px\"></A>";
sendHtmlMail("myemail@example.com","Subject",$message);
Here is the complete email which is returned including headers:
Delivered-To: oneal.michaels@gmail.com
Received: by 10.182.154.35 with SMTP id vl3csp1831038obb;
Sun, 6 Dec 2015 16:26:01 -0800 (PST)
X-Received: by 10.13.213.14 with SMTP id x14mr19939281ywd.229.1449447961510;
Sun, 06 Dec 2015 16:26:01 -0800 (PST)
Return-Path: <a6602671@srv10.000webhost.com>
Received: from postlady.000webhost.com (smtp5.000webhost.com. [31.170.163.248])
by mx.google.com with ESMTP id j63si14327386ywf.69.2015.12.06.16.26.01
for <oneal.michaels@gmail.com>;
Sun, 06 Dec 2015 16:26:01 -0800 (PST)
Received-SPF: pass (google.com: domain of a6602671@srv10.000webhost.com designates 31.170.163.248 as permitted sender) client-ip=31.170.163.248;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of a6602671@srv10.000webhost.com designates 31.170.163.248 as permitted sender) smtp.mailfrom=a6602671@srv10.000webhost.com
Received: by postlady.000webhost.com ([000webhost.com Mail Server], from userid 99)
id 59C5B602FC; Mon, 7 Dec 2015 00:26:01 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
postlady.000webhost.com
X-Spam-Level: ****
X-Spam-Status: No, score=4.6 required=7.0 tests=BODY_URI_ONLY,
HTML_IMAGE_ONLY_08,HTML_IMAGE_RATIO_02,HTML_MESSAGE,HTML_SHORT_LINK_IMG_1,
MIME_HTML_ONLY,TVD_RCVD_SPACE_BRACKET,T_RP_MATCHES_RCVD autolearn=disabled
version=3.3.2
Received: from srv10.000webhost.com (srv10.000webhost.com [31.170.160.74])
by postlady.000webhost.com ([000webhost.com Mail Server]) with ESMTP id 9924B602FB
for <oneal.michaels@gmail.com>; Mon, 7 Dec 2015 00:25:26 +0000 (UTC)
Received: by srv10.000webhost.com (Postfix, from userid 6602671)
id 929B018B5C7; Sun, 6 Dec 2015 19:25:26 -0500 (EST)
To: oneal.michaels@gmail.com
Subject: AeroBLOG - Verification Email: Welcome, MikeIsMyName
X-PHP-Script: aeroblog.tk/sendVerificationEmail.php for 172.73.244.114
MIME-Version: 1.0
Content-type: text/html; charset: utf8
From: <do-not-reply@aeroblog.tk>
Message-Id: <20151207002526.929B018B5C7@srv10.000webhost.com>
Date: Sun, 6 Dec 2015 19:25:26 -0500 (EST)
<HTML>
<HEAD>
<TITLE>AeroBLOG - Verification Email: Welcome, MikeIsMyName</TITLE>
<META http-equiv='content-type' content='text/html; charset=utf-8' />
<STYLE>
</HEAD>
<BODY>
<A href="http://aeroblog.tk/"><IMG src="http://aeroblog.tk/img/VerificationEmail.png" alt="copy & paste this link into your browsers navigation bar: http://........." width="1024px" height="768px"></A>
</BODY>
</HTML>