Jump to content

Recommended Posts

 

Hi,

 

I'm trying to send HTML emails via my site to people who enter their email address in a form. When I add an image to the email (as basic as <img src="photo.jpg" />) the email doesn't send. I still get a message on the screen to say it's sent (by using if 'mail' then echo 'ok' etc) but it's never received. It works on one of my websites but not the other. Could it be the domain provider or their php configuration? I can't think what else it could be and I NEED to sort it. Please can someone help!

 

Thanks!

  • 1 year later...

I also have almost the same problem and it seems no one is around to help us.

 

Mine sends the html email but the image doesn't appear, its only shows the placeholder of the image is showing.

 

Do you mind posting how you send your html email?

 

Good luck

 

@Mark: I think it was pretty obvious I wouldn't expect that. If you re-read my post you'll see that the problem wasn't getting the image to display, the problem was getting the email to send, which failed when the HTML image tag was included.

 

@blueman378: Hi mate, yes the two sites were hosted by different hosting companies and were subsequently on different servers. One of them worked fine but not the other. I think the one that worked was Linux and the one that failed was Windows.

 

@jkkenzie: Hi, I'm trying to remember what the issue was and how I resolved it, as this post was some time ago (July 2007)! If I remember correctly (which I may not), the problem wasn't specifically relating to the HTML image tag, but to the amount of characters in the email, which was obviously changing when I added or deleted the image tag. I think the issue related to base64 encoding. I don't have much knowledge of this but in short, forward slashes were being added in to my email which were affecting the output. I used the following which I think was the solution:

 

$headers .= "Content-Transfer-Encoding: base64\r\n"; // Add this to your headers
$body = rtrim(chunk_split(base64_encode($body))); // Add this to your body
mail($recipient, $subject, $body, $headers) // This is how I was sending the mail

 

Perhaps you could try that and see if it helps? If not, let me know and I'll think again.

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.