chriso20 Posted June 11, 2007 Share Posted June 11, 2007 Hey, trying to get a simple contact form working using PHP. I've been using this code just to simplify things; <?php // Your email address $email = "[email protected]"; // The subject $subject = "Enter your subject here 5"; // The message $message = "Enter your message here 5"; mail("[email protected]", $subject, $message, "From: $email"); echo "The email has been sent."; ?> [email protected] is my email address. I also have [email protected] for testing. It works for the msn account when i send it from something random - and i think not registered (eg. [email protected] works - where as trying a registered - eg. a friends email address won't work) The gmail account works for everything except for itself (sending mail to and from [email protected]) Is this something to do with msn/hotmail accounts? Thanks in advance! Chris Link to comment https://forums.phpfreaks.com/topic/55051-mail-doesnt-work-tofrom-some-email-addresses/ Share on other sites More sharing options...
chriso20 Posted June 11, 2007 Author Share Posted June 11, 2007 i've just set up a yahoo account (which recieves all emails - even from itself - sent from the php script) and a new hotmail account - which doesn't even recieve emails from the yahoo account! (recieved from the other msn email account, and sent emails no problem though) could this be because they're new email addresses? I'l keep this up to date - anyone got any ideas what's going on with the msn/hotmail accounts? Link to comment https://forums.phpfreaks.com/topic/55051-mail-doesnt-work-tofrom-some-email-addresses/#findComment-272144 Share on other sites More sharing options...
TEENFRONT Posted June 11, 2007 Share Posted June 11, 2007 Best thing to do is to send from your server. Log the script into pop3 before you send. This way it actually send like an email and not just spam which msn/gmail/yahoo will just whack in the trash folder. To send from hotmail to hotmail and gmail to gmail and yahoo to yahoo and vice versa..whatever, you need exta auth before sending from the relevent servers. Best thing is to send from your own domain name. Link to comment https://forums.phpfreaks.com/topic/55051-mail-doesnt-work-tofrom-some-email-addresses/#findComment-272145 Share on other sites More sharing options...
chriso20 Posted June 11, 2007 Author Share Posted June 11, 2007 thanks for the reply - sorted it Link to comment https://forums.phpfreaks.com/topic/55051-mail-doesnt-work-tofrom-some-email-addresses/#findComment-272178 Share on other sites More sharing options...
chriso20 Posted June 11, 2007 Author Share Posted June 11, 2007 ok new problem! I can get the form to send emails to anyone - saying they were from anyone (except msn/hotmail to msn/hotmail for some reason but that's not a problem for me) But when i reply to the email, it doesn't get through to the recipient. Even though their email address is right (granted it didn't come from them but it's going back to the right address yeah?) Do emails store some sort of information for where to send the email when replying other than an email address? Thanks Link to comment https://forums.phpfreaks.com/topic/55051-mail-doesnt-work-tofrom-some-email-addresses/#findComment-272185 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.