Page 1 of 1

Help with PHP E-mail

Posted: Sat May 22, 2004 5:19 am
by Think-Digitally
Hi, how can you put graphics, like a header in an e-mail. I hear that most e-mail facilites use different scripting. Is there anyway you can use a php include?

thanks

Posted: Mon May 24, 2004 12:19 pm
by Think-Digitally
Nobody know?

Posted: Mon May 24, 2004 1:42 pm
by d3ad1ysp0rk
As long as they accept HTML in emails,

Code: Select all

<?php
$to = "email@domain.com";
$title = "Nice looking email";
$content = "<html><body><img src="server.com/pic.jpg" />Some text<br />More text..</body></html>";
$headers = "From: email@yourdomain.com";
mail($to,$title,$content,$headers);
?>

Posted: Mon May 24, 2004 2:07 pm
by patrikG
my somewhat formulaic answer is: http://phpmailer.sourceforge.net ;)

Posted: Mon May 24, 2004 2:09 pm
by patrikG
LiLpunkSkateR wrote:As long as they accept HTML in emails,

Code: Select all

<?php
$to = "email@domain.com";
$title = "Nice looking email";
$content = "<html><body><img src="server.com/pic.jpg" />Some text<br />More text..</body></html>";
$headers = "From: email@yourdomain.com";
mail($to,$title,$content,$headers);
?>
Actually, 7-bit encoding can be handy with HTML, header content-type is another important issue...

Posted: Wed May 26, 2004 7:23 am
by Think-Digitally
Hi, thankyou for all your help. Although I do have a couple of questions, about the coding above.
What do I do to get the image, is it the website address and where the image would be, or would it be the path in ftp?
Also how can I make it so I can have an image in a form e-mail?

Thanks

Posted: Wed May 26, 2004 7:40 am
by magicrobotmonkey
it would be a URL (http://whatever.com/image.jpg) to the image