Search the Community
Showing results for tags 'mail()'.
-
Is php mail() function not working today? This is my base code: <!-- NO HTML CODE ABOVE --> <?php $email = "rogeriobsoares5@gmail.com"; $subject = "Email Test"; $message = "Hello, boy!"; mail($email, $subject, $message, "From: English U.P.<englishup19@gmail.com>\nX-Mailer: PHP/" . phpversion()); sentmessage = true; ?> <HTML charset="utf-8"> <HEAD> <TITLE>MAILER</TITLE> </HEAD> <BODY> <?php if(isset($sentmessage)){ if($sentmessage == true){ echo "Message sent successfully!"; } } ?> </BODY> </HTML> I've been testing several times today, but I'm not receiving the messages at all. Why is that the case? Would anybody know the answer? Thank you! AN IMPORTANT PIECE OF INFORMATION: It's not working when I send to my gmail accounts, but only when I set $email as my Hotmail account. Why?
-
On my hosting I using mail(...) function for email delivering. Looks like some changes was applied to smtp server and for some email addresses email not coming. For email based on gmail.com emails go to spam. For email based on google email for custom domains nothing delivered, even into spam folder. I could provide exact email for testing and resolving issue. Thx.
-
Hi everybody! I am trying to send an email through an PHP script for authentification sakes. It used to work out with the PHP mail() function. My syntax was: mail("example@example.com", "subject", "message", "From: myemail@example.com"); Now that I moved to Heliohost this doesn't seem to work out anymore. It doesn't give me an error message, but I just won't recieve the sent mail at example@example.com. What could be the reason for this? Is there anything I have to configure in cPanel or in my code to get PHP mail() to work? Or is there any other way I can send an email from my script? My preference would be an easy way to send that mail. I don't need to have special features like HTML-Email, just the way mail() used to serve it. Thankfully, blog2
-
Is there any restriction on sending e-mails using mail() to the same domain that is hosting the script? I'm slowly building my site during my free time and just noticed that my contact form isn't working properly. It spits out no error, but the mail never reaches it's destination. So, I've created the following test file (let's say my domain is "example.com"): <?php error_reporting(E_ALL); $to = "me@example.com"; $subject = "Test Mail"; $message = "Hello world!"; $headers = "From: no-reply@example.com"; echo mail($to, $subject, $message, $headers) ? "The email was sent" : "Fail!"; ?> Playing with this file I discovered that my mail never gets sent only if the recipient I've specified is from my own domain, the same domain which is hosting the script. If I change it to another one (gmail in this case) it works without problems: <?php error_reporting(E_ALL); $to = "me@gmail.com"; $subject = "Test Mail"; $message = "Hello world!"; $headers = "From: no-reply@example.com"; echo mail($to, $subject, $message, $headers) ? "The email was sent" : "Fail!"; ?> What really puzzles me is that this code works flawlessly in another host - and yes, using my domain. I've been using an DNS Round Robin to check out it's pros & cons and I'm able to test both hosts at the same time. Some useful (or not) information: My MX records are pointing directly to Google's records, since I'm using their Tools, and I'm also using an spf. I'm not using any nameservers, but A records only. The round robin has been working like a charm so far and the only problem I've encountered is the mail() one. I don't see how the round robin could have anything to do with this. If you need more info like seeing my DNS records, or how my mail headers looks like when I manage to send them (through the other host/to my gmail account) just ask. P.s.: English isn't my mother tongue, sorry about any weird sounding sentence. Also, I wasn't sure about where post it. Since it looks like a host-restriction, I've chosen this section.