Sending email via php

Status
Not open for further replies.

mindstorm8191

New Member
Messages
24
Reaction score
1
Points
3
Hi. I am trying to utilize email to help manage user accounts on my website. I have successfully sent email to my own account. However, the email address which it was from was 'bookalon@bookalong.x10host.com'. I'd like to change that to use one of my named email addresses on my account (such as admin@bookalong.x10host.com). PHP's mail() function allows you to do this, by way of their headers parameter.

I have set up a test page to send a sample message to my own email address, on Yahoo. This had worked previously without a header parameter. However, even though the mail() function returns successful, I never receive any email from my website, when providing headers to the function. Is there any reason why this wouldn't be working? I have tried using a different address as the sender name, but still having no results.

Here is my code (minus my own email address):

if(mail("myemailaddress@yahoo.com",
"test email",
"this is a test email. Please do not reply to this email; nobody will read it anyway",
"From: admin@bookalong.x10host.com\r\nReply-To: admin@bookalong.x10host.com\r\nX-Mailer: PHP/". phpversion())) {
echo('Third email test was successful');
}else{
echo('There was a problem sending the email');
}

If you could determine how to fix this, I would be grateful.

Thanks
 

mindstorm8191

New Member
Messages
24
Reaction score
1
Points
3
Hi. I'm not sure if someone corrected things or the system simply worked itself out, but I'm now receiving the emails that I sent (all the emails I sent...) :)

Thanks
 
Status
Not open for further replies.
Top