I found a nifty email script that I have used over and over again on various PHP servers, but I am only now experiening problems with it. On my server, I have been able to make an email form that functions correctly and send emails to almost all addresses except for when the user has an email address of the same domain as the host serving the website. I dont know if that makes any sense, so I'll explain it another way.
Let's say my site is called coolweb.com and I create an online form for visitors to fill out to send emails. The form will work as long as the user enters a valid "from" email address. The only time it doesn't work is when the user has an email address of the same host (@coolweb.com). When the user has the same email domain as the host, the script seems to die. This problem i also only unique to the site I set up today. on my personal host, I can send fromt eh same address the host uses with nor problems. Can anyone give me any ideas why the host email address would cause the mail function to error out? Thansk.
email question
Moderator: General Moderators
I don't have a clue. The only reason I am responding is to warn you that many people probably won't even bother responding, because you are missing some of the real basic things people need to know to help you.
Server
mail program
for one, seem almost obvious, no?
how about what function you are using? should we assume it is mail(), or is it some coolscript that does direct socket manipulation, or what?
If you set up the server, does that mean you have access to logs? Well then, how about you look in your mail log AND your error log and see whats up?
Server
mail program
for one, seem almost obvious, no?
how about what function you are using? should we assume it is mail(), or is it some coolscript that does direct socket manipulation, or what?
If you set up the server, does that mean you have access to logs? Well then, how about you look in your mail log AND your error log and see whats up?
Funny thing... I only write the function that posts the mail. I don't have access to either the mail log or the error log because. I developed and tested the pages on my server and then gave them to my friend to upload to his client's site. That's when this error came up. The function I am using is indeed mail(). The script I downloaded that I suspected was causing some error checks email addresses for validation, but I have disovered that this is not causing any such errors as I can send emails on other hosts fine using the exact same code.
My code is below:
if (@mail($mailto, $subject, $message)) {
print "Your email was successfully sent. We will reply to your message soon. Thank you";
} else {
print "Your e-mail could not be sent. Please use your back button to try again We apologize for the inconvenience";
}
Any reason why this would stop working just because the server host and the email address have the same domain name?