Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php email 1

Status
Not open for further replies.

dugen

Programmer
Jun 16, 2003
59
US
I have some php code here that sends an email to a friend when a simple form is filled out. The email function is working fine. I was just wondering how can I add an image that will show up in the email message?

?php
$myemail = $visitormail;
?>

</font>
</b>
<br>

<?php
$ip = getenv("REMOTE_ADDR");

$notes = stripcslashes($notes); $messageis = " $todayis \n
Your Friend: $visitor ($visitormail)\n
Sent you this message:

///////////////////I want an Image here
<img src="image1" alt=image 1>
/////// I get the following error when trying to add the image this way:
Parse error: parse error, unexpected T_STRING in /usr/home/sites/ on line 60

//Email Text
Hi, thought that you might be interested in this.

Text Here.............



$messageme = $ip . " " . $messageis;

$from = "From: $myemail\r\n";

if ($friendmail != "")
mail($friendmail, $sitename, $messageis, $from);

?>

Thanks for any help
 
You have to escape the special character ",
try <img src=\"image.jpg\" alt=\"image one\">
 
You are talking multi-part MIME mail here.
I recommend that you take a look at the PHPMailer class on sourceforge. It allows multi-part mime mail and is the best mail class out there:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top