email question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
flakeboy
Forum Newbie
Posts: 3
Joined: Fri Aug 01, 2003 3:14 am

email question

Post by flakeboy »

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.
jmarcv
Forum Contributor
Posts: 131
Joined: Tue Jul 29, 2003 7:17 pm
Location: Colorado

Post by jmarcv »

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?
flakeboy
Forum Newbie
Posts: 3
Joined: Fri Aug 01, 2003 3:14 am

Post by flakeboy »

:(
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?
jmarcv
Forum Contributor
Posts: 131
Joined: Tue Jul 29, 2003 7:17 pm
Location: Colorado

Post by jmarcv »

Still don't know what mail program your friends host has, probably doesn't matter, but in the past with sendmail issues have been configuration, permissions, forwarding rules, so your friends clients hosting company needs to figure it out.
flakeboy
Forum Newbie
Posts: 3
Joined: Fri Aug 01, 2003 3:14 am

Post by flakeboy »

Thanks. Thats what I figured too. I was all stressed trying to figure out what could be wrong with the code I wrote, but it turns out that my friend's client called his host to complain and they admitted it was their fault, so they're going to fix it. Thanks for your help though. =)
Post Reply