Images via mail()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Images via mail()

Post by Joe »

I am playing around with the mail() function to see what I can do and I have came to a hault. I have tried to insert images in the message but it does not seem to work. The mail content is simple:

$EmailContent = '<img src="http://www.site.com/logo.jpg">Hello There';

All it shows is the html and no image,

Any help appreciated


Joe 8)
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Your email is set to receive text only.
What provider are you using?
Try setting up a test hotmail account just to fool around with, because I know hotmail can receive html.
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Yes I done it on hotmail as I realised paypal emails had the images. Still no luck though
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Code: Select all

<?php mail("youremail@hotmail.com","My PHP script mailer","This is my email!<br /><img src="http://site.com/img.jpg" />","From: myemail@server.com"); ?>
Does that show up correctly?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it should parse error ;).. even if it worked, it should show up as plain text.. (no content type for HTML)
Post Reply