Forum Moderators: coopster

Message Too Old, No Replies

Sending 2 emails at once

Advice welcome

         

Patrick Taylor

3:24 am on Feb 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm using the following line in a PHP script, to send a visitor an email from my web page. The $_POST['email'] variable is whatever they enter as their email address into a form:

mail ($_POST['email'], 'Title ', $body);

I also would like the same script to send a little email to me at the same time, with a short message to myself - not the main body variable shown above.

Could anyone please explain what I should add into the above code? All I really want is to receive their email address.

Regards,

Patrick

Knowles

1:04 pm on Feb 29, 2004 (gmt 0)

10+ Year Member



mail ($_POST['email'], 'Title ', $body);
$thereemail = "From: $_POST['email']";
$me = "me@me.domai";
mail ($me, 'Email' , '$POST_['email']', $thereemail);

That will make it be from them and put their email address into the body of the email address. Just a quick way to show you.

Patrick Taylor

10:37 pm on Feb 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the reply. I did it this way, with 2 separate lines:

mail ($_POST['email'], 'Title', $body, 'From: admin@mydomain.com');
mail ('admin@mydomain.com', 'Someone requested... ', $_POST['email']);

It works okay.