Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

How to insert image in mail body when user click on send button. I am using php mail

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
342 views
Welcome To Ask or Share your Answers For Others

1 Answer

To create an HTML email you can do something like this:

...
$message = "<html><head></head><body>";
$message .= "<img src='link-image.jpg' alt='' /></body></html>";

$headers = "From: $from_email";
$headers .= "Content-type: text/html";

mail($to, $subject, $message, $headers);

This should build an HTML email for you and you should then be able to insert just normal html.

edit You can read more about how to create HTML emails using PHP from here: http://css-tricks.com/sending-nice-html-email-with-php/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...