Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to display image in user mail

    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>"))

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    You'll need to send the email as html, not plain text

    PHP Code:
    <?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);
    ?>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •