How Do You Create Autoresponder Email Messages In Php?


Tags: , , ,

2 Responses to “How Do You Create Autoresponder Email Messages In Php?”

  1. NC Says:

    create auto responder mail message on your form validation page.
    here i give the sample code for this:
    < ?php
    $from = "test@gmail.com";
    $to = "$Email";
    $subject = "Thanks for contacting us";
    $message = 'Your request/inquiry has been received and someone will be contacting you shortly!
    Thank You
    Respectively,
    Maximus';
    $headers = "From: $from";
    mail($to,$subject,$message,$headers);
    ?>

  2. Maximus Says:

    < ?
    /***********************
    CLASS :: MYMail
    ************************/
    class MyMail{
    var $To;
    var $ToSender;//If you want the email to go to the sender
    var $Subject;
    var $Msg;
    var $Headers;
    var $From;
    var $ReplyTo;
    /*
    $headers = 'From: webmaster@example.com‘ . “rn” .
    ‘Reply-To:
    webmaster@example.com‘ . “rn” .
    ‘X-Mailer: PHP/’ . phpversion();
    mail($to, $subject, $message, $headers);
    ***&&&&&*******
    For HTML Mail
    ‘MIME-Version: 1.0′ . “rn”;
    $headers .= ‘Content-type: text/html; charset=iso-8859-1′ . “rn”;
    */
    function MyMail($To, $Subject, $Msg, $From, $ReplyTo){
    $this->To=(empty($To)) ? “0″ : $To;
    $this->Subject=(empty($Subject)) ? “0″ : $Subject;
    $this->Msg=(empty($Msg)) ? “0″ : $Msg;
    $this->From=(empty($From)) ? “0″ : $From;
    $this->ReplyTo=(empty($ReplyTo)) ? “0″ : $ReplyTo;
    $this->Headers=”MIME-Version: 1.0″ . “rn” . “Content-type: text/html; charset=iso-8859-1″ . “rn” . “From:” . $this->From . “rn” . “Reply-To:” . $this->ReplyTo . “rn” . “X-Mailer: PHP/” . phpversion();
    //Use this array if you want to send to only one person
    $SetMail=array(
    ‘To’=> $this->To,
    ‘Subject’=> $this->Subject,
    ‘Msg’=> $this->Msg,
    ‘Headers’=> $this->Headers,
    ‘From’=> $this->From,
    ‘ReplyTo’=> $this->ReplyTo
    );
    //Use this array if you want it to go to multiple people (the sender/CC:/Bcc:)
    /*
    $SetMail=array(
    ‘To’=> $this->To . “,” . $ToSender,
    ‘Subject’=> $this->Subject,
    ‘Msg’=> $this->Msg,
    ‘Headers’=> $this->Headers,
    ‘From’=> $this->From,
    ‘ReplyTo’=> $this->ReplyTo
    );
    */
    if(in_array(“0″,$SetMail)){
    echo “

    Something wrong with the mail! Please make sure all fields are filled in!

    “;
    return;
    }
    else{
    if(!mail($SetMail['To'], $SetMail['Subject'], $SetMail['Msg'], $SetMail['Headers'])){
    echo ““;
    }
    }
    }
    }
    ?>
    and call the class like this
    Code:
    $MyMail=new MyMail($To=”Email address”, $Subject=”Subject”, $Msg=Message or body, $From=”From email address”, $ReplyTo=”reply to email address.or use from email address”);

Leave a Reply

FREE Report for You!

First Name

E-mail Address

Subscribe Unsubscribe

eMail Marketing Tips
Please Visit Our Sponsors!
Articles
  • Email Marketing Software- Helpful Guideline For Marketing
  • Make Best Use of Email Marketing Services
  • Use Email Marketing Services to Promote a Brand
  • High & Low Risk Email Marketing
  • Email Blasting VS Email Marketing, What Is The Difference?
Great Marketing Tools