Thursday, 7 June 2012

sending mail dynamically using function




this is code for sending the mail using the fucntion with effects like normal mail id as well as GUI effects


this is the code for the sending mail mail set up local from ,subj,cc,bcc


 // $headers .= "Reply-To: support@mmad.in \r\n";
                     // $headers .= "BCC: gopal@**********.in,balaji@*************.in\r\n";
                  


 $to =$email.',issacbalaji@yahoo.com';                  
                      $subject = "MMAD Registration ";
                      $mailfrom = "sales@**********.in";
                      $headers = "From:" . $mailfrom;
                      $message=$body;
                      $subject = 'Registration Confirmation - ***************';
                     $message = '



 function send_register_mail($fName,$lname,$address,$city,$state,$pin,$email,$mobile,$phone) {

   /*************to customer**********************/
                   
                      $to =$email.',issacbalaji@yahoo.com';                    
                      $subject = "MMAD Registration ";
                      $mailfrom = "sales@mmad.in";
                      $headers = "From:" . $mailfrom;
                      $message=$body;
                      $subject = 'Registration Confirmation - MMAD Online Store';
                     $message = '
                      <html>
                          <head>
                              <title>Registration Confirm</title>
                              <style>
                                    html{background:#e6e6e6 url("http://i.mmad.in/images/home_headertext.png") 50% 0 repeat;}
                                    body{background:url("http://i.mmad.in/images/home_headertext.png") 50% 0 repeat-x; padding:0;}
                              </style>
                          </head>

                              <body bgcolor="#e6e6e6">
                              <p></p>
                              <table bgcolor="#e6e6e6">
                                  <tr>
                                      <td>
                                          <table width=700>
                                            <tr>
                                                <td  align=left><img src="http://i.mmad.in/images/logo_mamidi.png" />&nbsp;</td>
                                                <td align=right><img src="http://i.mmad.in/images/logo_url.png" /><br/><font color="#213993"> &nbsp;Support Related<br>&nbsp;&nbsp;&nbsp; 080-49048150</font></td></tr>
                                          </table>
                                      </td>
                                  </tr>
                                  <tr>
                                    <td>
                                        <p>Dear '.$fName.',</p>                                      
                                        <p>
                                            <fieldset>
                                                    <legend><font color="#000000" size=5><b>Registratio Details details<b/></font></legend>
                                                


                                            

                                            </fieldset>
                                        </p>

                              </td></tr>
                

                              </table>
                              </body>
                          </html>
                      ';

                 
                       // To send HTML mail, the Content-type header must be set
                      $headers  = 'MIME-Version: 1.0' . "\r\n";
                      $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

                      // Additional headers
                      $headers .= 'From: Registration Confirmation <sales@mmad.in>' . "\r\n";
                     // $headers .= "Reply-To: support@********.in \r\n";
                     // $headers .= "BCC: gopal@*********.in,balaji@************.in\r\n";
                     // $headers .= "BCC: balaji@**********.in\r\n";
                      mail($to, $subject, $message, $headers);

}

No comments:

Post a Comment