...

View Full Version : How to display image in user mail



bhagyaa2ze
02-23-2007, 11:52 AM
iam new tpo PHP,please help me that how to display the images in the user email.


If we send the email to the user it is not displaying the images.We are using SMTP server.Please help me how to send the images.

$subject = "YOUR INFO AT XPRSEC.COM";
$message = "\n";
$message .= "WELCOME TO XPRSEC.COM";
$message .= "\n";
$message .= "Dear sirs,";
$message .= "\n";
$message .= "This is the email id of the person who is interested to Join XPR.";
$message .= "\n";
$message .= "---------------------------- \n";
$message .= "".USERNAME.": $email \n" ;
$message .= "".PASSWORD.": $pass \n";
$message .= "---------------------------- \n";
$message .= "\n" ;
$message .= " Your Account is currently Active.";
$message .= "\n" ;
$message .= "$site_url \n";
$message .= "\n";
$message .= "PLZ DONT FORGOT PWD";
$message .= " \n";
$message .= "THANKS FOR REGISTERING";
$message .= "\n";
$message .= "-- \n";
$message .= "XPRSEC";
$message .= "http://www.xprsec.com/";
$message .= "\n";
$message .= "\n";
$message .= "THIS IS AN AUTO GENERATED MAIL" ;
$message .= "REPLY TO THIS WILL BE IGNORED";
if(!mail($email,$subject,$message, "FROM: XPR <subu@a2zeservices.com>"))

Nightfire
02-23-2007, 11:56 AM
You'll need to send the email as html, not plain text



<?php
//add From: header
$headers = "From: webserver@localhost\r\n";

//specify MIME version 1.0
$headers .= "MIME-Version: 1.0\r\n";

//unique boundary
$boundary = uniqid("HTMLDEMO");

//tell e-mail client this e-mail contains//alternate versions
$headers .= "Content-Type: multipart/alternative" .
"; boundary = $boundary\r\n\r\n";

//message to people with clients who don't
//understand MIME
$headers .= "This is a MIME encoded message.\r\n\r\n";

//plain text version of message
$headers .= "--$boundary\r\n" .
"Content-Type: text/plain; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode("This is the plain text version!"));

//HTML
version of message
$headers .= "--$boundary\r\n" .
"Content-Type: text/html; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode("This the <b>HTML</b> version!"));

//send
message
mail("root@localhost", "An HTML Message", "", $headers);
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum