Forum Moderators: coopster

Message Too Old, No Replies

Email sending from address to be actual sender's

         

smartcard

11:51 am on Sep 8, 2007 (gmt 0)

10+ Year Member



I am using a script to send an email to me whenever someone registered in my custom make PHP script site. Following is the extract of the email sending function of my code.

The problem is I need this script to send the mail where from address should be the actual user’s address (i.e. if email@example.com register a new account I need this system to send the following mail that should look like coming from email@example.com


$FromName = $Email;
$ToEmail = $listmail;
$Message = "
Please subscribe me

User Name : " . $UserName . "
Mailing : " . $Mailing . "
Name : " . $CustomerName . "
Email : " . $Email . "

Thank you

Can some body help me on this fixing?

[edited by: eelixduppy at 2:17 pm (utc) on Sep. 8, 2007]
[edit reason] removed email [/edit]

phranque

1:56 pm on Sep 8, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



perhaps you could post some code where an actual sendmail or something is invoked.

smartcard

2:27 pm on Sep 8, 2007 (gmt 0)

10+ Year Member



Following is the script sending the email. I believe that there is a fix needed in the 2nd line?


$Subject = "Subscribe to List";
$FromEmail = "From: " . $FromName . "<" . $FromEmail . ">\r\n";
if (mail($ToEmail, $Subject, $Message, $FromEmail) == true)
{
$strMessage = "A CONFIRMATION MAIL HAS BEEN SENT TO YOUR MAILBOX WITH LOGIN INFORMATION. PLEASE LOGIN TO CONTINUE SHOPPING";
}
else
{
$strMessage = "CONFIRMATION MAIL SENTING FAILED TO YOUR MAILBOX";
}
echo "

";

phranque

1:17 am on Sep 9, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



$FromEmail = "From: " . $FromName . "<" . $FromEmail . ">\r\n";

you are reassigning the value of $FromEmail - does it have a value before that?
are you getting an error from the mail function or is it just not sending?