Jump to content

Recommended Posts

Im stumped and cant seem to find a solution or example to help so am posting here. I have a web form that collects information from the user and when they submit sends an email to a particular address with a message body. That works fine but i want to send at the same time another email to another recepient with a different body message. I thought i could create another msg and send with this new body message but this then doesnt allow the first messgage to be sent

 

<?php

//build the mail message

$msg="*******.\r\n";

$msg.="********.\r\n";

$msg.="********.\r\n";

$msg.="******\r\n";

$msg.="Name: ".$_POST["fname"]." ".$_POST["lname"]."\r\n";

$msg.="\r\n";

 

//set up email for store

$recipient="email@domain.com";

$subject="*******";

$mailheaders="From: ********* \r\n";

$mailheaders.="Reply-To: ".$_POST["cemail"];

 

$to="email@domain.com";

$csubject="*******n";

$headers="From: > \r\n";

 

//send mail to Customer

mail($recipient,$subject,$msg,$mailheaders);

$msg1="*******.\r\n";

$msg1.="********.\r\n";

$msg1.="********.\r\n";

$msg1.="******\r\n";

$msg1.="Name: ".$_POST["fname"]." ".$_POST["lname"]."\r\n";

$msg1.="\r\n";

 

mail($to,$csubject,$msg1,$headers);

?>

check each mail by them selfs i think the first mails header is wrong but you have removed alot so its hard to say

 

try a simple test like this

mail('user1@example.com', 'My Subject1', 'hello');
mail('user2@example.com', 'My Subject2', 'world');

 

but also keep inmind that some hosts block mass mails so you will need to wait a few seconds before sending the next mail!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.