Hi,
Can anybody tell me that how can I send email in PHP on behalf of any user...
Email on behalf of user
Moderator: General Moderators
From
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";
}