Page 1 of 1

Email on behalf of user

Posted: Fri Oct 12, 2007 12:29 am
by satalways
Hi,
Can anybody tell me that how can I send email in PHP on behalf of any user...

From

Posted: Fri Oct 12, 2007 5:18 am
by N1gel
Here is an example, you add the from into the header passed to the mail function.

Code: Select all

$to      = $email;
$subject = "new e-mail";
$message = "Hello I'm Your E-Mail";
$headers = "From: noreply@mywebsite.co.uk\r\n".'Cc: me@mywebsite.co.uk';

if( mail($to, $subject, $message, $headers) )
{
        echo "Mail Sent!!!";    
}
else
{
        echo "Unable to send mail";
}

Posted: Fri Oct 12, 2007 10:08 am
by satalways
Dear friend,
please read again my question. You told me simple email sending method. I asked that how can we send email from behalf of any other person.