Multi Receipt mail script is not working.

the mail() function

Moderators: macek, egami, gesf

elitefox
New php-forum User
New php-forum User
Posts: 1
Joined: Sun Apr 28, 2013 10:20 pm

Multi Receipt mail script is not working.

Postby elitefox » Sat Jun 08, 2013 1:14 am

Please help me with this function

why its not working?

Code: Select all

<?php
$title="Contact Us";
$page="contact";
include('templates/header-inner.php');

if(isset($_POST['submit'])=='Submit')
{
   $frm = $_POST;

   if($frm)
   {
      $err=0;
      $input_email=$frm["email"];
      if(empty($frm["name"]))
      {
       $err=1;
       $msg= "Please enter your name";
      }
      if(empty($frm["email"]))
      {
       $err=1;
       $msg= "Please enter the email";
      }
      if(!preg_match('/@[a-zA-Z0-9\_\-]+\.[a-zA-Z0-9\_\-]{2,10}$/',$input_email))
      {
       $err=1;
       $msg .= "Invalid email address, Please enter correct email";
      }
      if(empty($frm["mobile"]))
      {
       $err=1;
       $msg= "Please enter mobile number";
      }
      if(empty($frm["enquiry_details"]))
      {
       $err=1;
       $msg= "Please enter enquiry details";
      }
      
      if(!$err)
      {
         $to="i.g.pradeep@hotmail.com , i.g.pradeep@gmail.com";
         $email=$frm["email"];
         $name=$frm["name"];
         $mobile=$frm["mobile"];
         $address=$frm['address'];
         $enquiry_det=$frm['enquiry_details'];
         $msg_ok= "Your enquiry details successfully sent.Thank you!";
         $message = "From: <b>".$name."</b><br />
                  Email: <b>".$email."</b><br />
                  Phone/Mobile:<b>".$mobile."</b><br />
                  Address:<b>".$address."</b><br />
                  Enquiry Message:<br />
                  ----------------------------------------------------------<br />
                  ".nl2br($enquiry_det)."<br />
                  ----------------------------------------------------------<br />";
         $headers = "From: ".$name. " <".$email.">\nContent-Type: text/html; charset=iso-8859-1\nX-Mailer: PHP/" . phpversion();
         mail($to, "New Enquiry",$message, $headers);
         $msg_ok= "Your enquiry details successfully sent.Thank you!";
            
      }

   }
}
?>

developerahusain
New php-forum User
New php-forum User
Posts: 44
Joined: Tue May 28, 2013 10:04 pm
Location: India,Lucknow

Re: Multi Receipt mail script is not working.

Postby developerahusain » Sat Jun 08, 2013 4:28 am

Here is the entire code i'm using for sending multi receipt mail

//you should do it like this to send multiple mails
$to ="pradeep@hotmail.com,pradeep@gmail.com";
$subject ='Job Opportunity @ m`brace';
$message ='<head>
<title>Untitled Document</title>
<link href="../include/css/style.css" rel="stylesheet" type="text/css" />
</head>

<body>your content goes here</body';

$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

// More headers
$headers .= 'From:'.$_POST['from']."\r\n";

mail($to,$subject,$message,$headers);

developerahusain


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest

cron