I am using amazon free tier EC2 instance and installed every required packages like php, apache, mysql etc. and evrything is working perfect.
Now I need to send/receive HTML email from my application which is running in EC2 so I have created Amazon SES instance and verified my domain as well email address which I am using to send/receive email. And I also created amazon workmail instance so I can receive my emails over there.
Logo image of my site is linked in all html emails.
Now when I send email from my application to the user like signup, forgot password etc. everything is working good.
But when user sends email to my application like contact us, my email client(Amazon Workmail) showing broken image for same logo image which am using in signup email.
I have searched for that and got some solutions like clear caching, renaming logo image but unfortunately not working for me. My server is SSL enabled. is that can be the issue? But I couldn't get that it's working when emails are being opened in gmail, yahoo etc. So what what can be the issue with the amazon workmail?
Can anyone please help me? Thanks!
Update:
This is my code:
$uname = $name;
$to = $to_email;
$from = $from_email;
$subject = "Contact Request from " . $uname;
$content = "<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1'>
</head>
<body style='margin:0px; font:Verdana, Arial, Helvetica, sans-serif;' bgcolor='#FFFFFF'>
<!-- HEADER -->
<table style='width: 100%; max-width:630px; margin-left:auto; margin-right:auto;' bgcolor='#008FD4'>
<tr>
<td width='100%'>
<div style='font-family:Verdana, Arial, Helvetica, sans-serif;max-width: 600px; margin: 0 auto;display: block;'>
<table width='100%' bgcolor='#008FD4'>
<tr>
<td><img width='130px' src='https://path/to/image' alt='image'></td>
<td align='right'><h2 style='margin:0;padding:0; color:#FFF;'></h2></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<!-- /HEADER -->
<!-- BODY -->
<table style='width:100%; font-family:Verdana, Arial, Helvetica, sans-serif;'>
<tr>
<td style='display:block!important; max-width:630px!important; margin:0 auto!important; /* makes it centered */clear:both!important;' bgcolor='#FFFFFF'>
<div style='padding:15px;max-width:600px;height:auto;margin:0 auto;display:block;background-color: #e2e7eb; '>
<table>
<tr>
<td>
</h3> <p style='padding:15px; background-color:#ECF8FF; margin-bottom: 15px;font-size:14px; margin:10px;'>
Name: " . $uname . " <br /><br />
Email Address: " . $from . " <br /><br />
Message: " . $message . "<br /><br />
</p>
</td>
</tr>
</table>
<h3>User Profile:</h3>
<table>
<tr>
<td>
</h3> <p style='padding:15px; background-color:#ECF8FF; margin-bottom: 15px;font-size:14px; margin:10px;'>
First Name: " . $fname . " <br /><br />
Last Name: " . $lname . " <br /><br />
E-mail: " . $profile_email . " <br /><br />
Phone Number: " . $phone . " <br /><br />
Organization/Company Name: " . $company . " <br /><br />
Designation/Title: " . $designation . " <br /><br />
Address: " . $address . " <br /><br />
City: " . $city . " <br /><br />
State/Province/Territory: " . $state . " <br /><br />
Country: " . $country . " <br /><br />
Zip code/Pin Code: " . $zip . " <br /><br />
</p>
</td>
</tr>
</table>
</div>
<div style='padding:1px 1px 1px 15px;height:auto;margin:0 auto;display:block;background-color: #008FD4;'>
</div>
</body>
</html>";
//set header part for email
$headers = "From: $from" . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
if( $ok = mail($to, $subject, $content, $headers) ) {
---
}
All the variables used in above code like $fname
, $lname
are assigned with values provided in contact us
form