Anyone come across a solution for sending emails from GoDaddy hosting using php mail() function? My scripts will work with other web host providers, having issues with GoDaddy where sent email has 'FROM: ' in the from headers? // Sample -------------------------- $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "To: $EmailTO \r\n"; $headers .= "From: $EmailFrom <$EmailFrom>\r\n"; $headers .= "Cc: \r\n"; $headers .= "Bcc: \r\n"; mail($to, $subject, $message, $headers); Code (markup):
I am using php mail on GD with no apparent problems. Old script with globals on. I have sent you an message source code sent from there in the hopes it might help you.
Colbyt - thanks for your help and PM The php.net site, under the mail() functions, also has a nice simple Godaddy working example Resolved - thanks again!
I too am having some trouble getting the mail function to work right on a GoDaddy windows server. I saw the example on php.net, but I'm not quite sure how to implement it correctly. Where do I get the mail.php file from. And since the code has PEAR in it, do I need to save the file that the function is in as a different format then php? I've never worked with PEAR before. I've tried just copying the function as it is, and of course inserting the user/pass for the account, but it doesn't seem to be working. I think it is because it can not find the mail.php file. Any help with this would be great, thanks!
rightsidenov, there's a post on php.net that I used that worked require_once "Mail.php"; function emailHtml($from, $subject, $message, $to) { $host = "localhost"; $username = ""; $password = ""; $headers = array ('MIME-Version' => "1.0", 'Content-type' => "text/html; charset=iso-8859-1;", 'From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => false)); $mail = $smtp->send($to, $headers, $message); if (PEAR::isError($mail)) return 0; else return 1; } Code (markup): Need to use their Mail.php script Hope this helps
Godaddy does not allow the mail function because spammers have been using it and abusing it to mass mail people. But test it one more time with this: Sitepoint Post here: http://www.25x.us/?urqgNGYeRU
Hi all, I am having the same mail problem with godaddy server, site is hosted on godaddy's windows server (shared hosting). I have gone through with all the solutions given above and try to use these but it does'nt seems to work. Please suggest me a way.
Contact GoDaddy admin and ask that they transfer you to a server that supports PHP5. You may be on a server that only supports PHP4.
This is how I sorted out this for WordPress on Godaddy. It might help for any future user who is looking for php mail with GoDaddy. http://www.expertcore.org/viewtopic.php?f=74&t=1079
try this hope work for you 1) Install the WP-Mail-SMTP plug-in. Activate it. 2) Enter your From Email and Name 3) Setup the Mailer settings as follows: Mailer: * Use the PHP mail() function to send emails. SMTP Options SMTP Host: relay-hosting.secureserver.net SMTP Port: 25 Encryption: * No encryption. Authentication: * Yes: Use SMTP authentication. 4) Enter your valid email account credentials. Username: Password: 5) Update options. 6) Send test mail. You should get this result: Test Message Sent The result was: bool(true)
If you are using shared hosting it is very likely the server IP is black listed. It is better you use a VPS where your IP is only for you, or use SMTP with external email provider.