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
    Nov 2002
    Location
    Netherlands
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Multiple 'from' - headers issue

    Hi,

    Sofar I have this
    PHP Code:
    <?php
    $contact_name 
    $_POST['name'];
    $contact_email $_POST['email'];
    $contact_subject $_POST['subject'];
    $contact_message $_POST['message'];

    if( 
    $contact_name == true )
    {
        
    $sender $contact_email;
        
    $receiver "your@email.com";
        
    $client_ip $_SERVER['REMOTE_ADDR'];
        
    $email_body "Hallo...,\n\n$contact_name, has visited your website and sends you the following question or remark: \n-----------------------------------------\n$contact_message \n-----------------------------------------\n\nContact details: \nName: $contact_name \nE-mailadres: $sender \nIP-adres: $client_ip \n";        

        
    $emailAutoReply "Dear $contact_name, \n\nWe have just received your below question or remark:\n-----------------------------------------\n$contact_message \n-----------------------------------------\n\nWe thank you for your interest. As soon as your serious intentions are clear to us, we will contact you. \n\nregards,\n\nCOMPAGNY NAME \nuw your special store \nAddress..........\nTel.: 0000 - 000000 ";

        
    $extra "From: $sender\r\n" "Reply-To: $sender \r\n" "X-Mailer: PHP/" phpversion();
        
    $autoReply "From: $receiver\r\n" "Reply-To: $receiver \r\n" "X-Mailer: PHP/" phpversion();

        
    mail$sender"Auto Reply: $contact_subject"$emailAutoReply$autoReply );
        
        
        if( 
    mail$receiver"Website reactie: $contact_subject"$email_body$extra ) ) 
        {
            echo 
    "success=yes";
        }
        else
        {
            echo 
    "success=no";
        }
    }
    ?>
    What I would like is both mails in HTML. In all my efforts I get stuck with the headers which has to be set to sent mail in HTML
    This part '$email_body' and this part '$emailAutoReply' should be sent as HTML. If not possible perhaps only '$emailAutoReply' in HTML (so I can include the company Logo) and the other one in plain text is possible?

    Thanks for your help in advance
    Last edited by Membie; 11-20-2010 at 07:59 PM.

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,133
    Thanks
    12
    Thanked 332 Times in 328 Posts
    you can of course send HTML+Text mails, though I would use a mailing library for that (takes off the hassle of creating the necessary headers and boundaries)
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer


  •  

    Tags for this Thread

    Posting Permissions

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