user1170392
user1170392

Reputation:

php mail issue with godaddy

Okkkk...I don't know much about the PHP mail function so don't blast me for this. The problem is this...I'm hosting my own site using the freedns.afraid.org nameservers and when you go to my domain it redirects to my no-ip domain. I am hosting use xampp. I have my domain registered under godaddy and also my email. Here is how I have everything set up from my configs to my code. For reason unknown to me, I can't send emails! I probably have this whole thing messed up but I'm just asking for help.

php.ini

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = relay-hosting.secureserver.net
; http://php.net/smtp-port
smtp_port = 3535

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = [email protected]

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

my sendmail config

[sendmail]

smtp_server=relay-hosting.secureserver.net
smtp_port=3535
error_logfile=error.log
debug_logfile=debug.log
auth_username=
auth_password=
force_sender=

my html and php test email code

<html>
<head><title>PHP Mail() test</title></head>
<body>
This form will attempt to send a test email. Please enter where this test should be sent to<br><p>
<form action = "mail.php" method = "post" name="sendmail">
Enter an email address: <input type = "text" name = "to"><br>
<input type="submit" value="Send" name="submit"><input type="reset" value="Reset" name="reset"><br><p>
<?php
if(isset($_POST['to'])) {
       $mail_to=$_POST['to'];
    $mail_subject="Test email from";
    $mail_body="This is a test email, sent from ";
    $header = "<[email protected]>";

    if(mail($mail_to, $mail_subject, $mail_body,$header,"[email protected]")) {
        print "Email sent successfully!";
    } else {
        print "Email did not send!!!!!";
    }
}
?>
</body>
</html>

Debug info

12/03/08 11:08:42 ** This is a test email, sent from 
12/03/08 11:08:42 ** --- MESSAGE END ---
12/03/08 11:08:42 ** Connecting to relay-hosting.secureserver.net:3535
12/03/08 11:08:52 ** Disconnected.
12/03/08 11:08:52 ** Disconnected.
12/03/08 11:08:52 ** Disconnected.
12/03/08 11:08:52 ** Disconnected.
12/03/08 11:08:52 ** Connect timed out.
12/03/08 11:29:18 ** --- MESSAGE BEGIN ---
12/03/08 11:29:18 ** To: [email protected]

Also I get this error

Warning: mail() [function.mail]: Failed to connect to mailserver at "relay-hosting.secureserver.net" port 3535, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\Test\mail.php on line 20

12/03/08 11:29:18 ** Subject: Test email from
12/03/08 11:29:18 ** Content-type: text/html
12/03/08 11:29:18 ** From: "PHP mail() Test Script"<noreply@>
12/03/08 11:29:18 ** 
12/03/08 11:29:18 ** This is a test email, sent from 
12/03/08 11:29:19 ** --- MESSAGE END ---
12/03/08 11:29:19 ** Connecting to relay-hosting.secureserver.net:3535
12/03/08 11:29:29 ** Disconnected.
12/03/08 11:29:29 ** Disconnected.
12/03/08 11:29:29 ** Disconnected.
12/03/08 11:29:29 ** Disconnected.
12/03/08 11:29:29 ** Connect timed out.

Upvotes: 1

Views: 6936

Answers (2)

James R
James R

Reputation: 379

The error that you provided shows that you are attempting to use “relay-hosting.secureserver.net” as the relay server in your application. That address is a gateway for email leaving Go Daddy webhosting servers. It will not be available from a Go Daddy Dedicated server or from a personal server not located within a Go Daddy datacenter. If you are hosting this on a Go Daddy Virtual or Dedicated server you can get your personal relay server information from the Go Daddy support chat. If you are hosting this application outside of the Go Daddy network you will need to get the correct relay information from your hosting or network provider. Hope this helps.

Upvotes: 1

Manse
Manse

Reputation: 38147

You should comment out the sendmail_path... this is from the help http://uk.php.net/manual/en/mail.configuration.php#ini.sendmail-path

This directive works also under Windows. If set, smtp, smtp_port and sendmail_from are ignored and the specified command is executed.

Also check the debug.log - there should be some pointers in there ...

Your header

$header = "<[email protected]>";

isnt valid, try something like :

$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]';

Upvotes: 0

Related Questions