PHP mailer
Posted: Tue Mar 09, 2010 9:40 pm
This is my first post, so let me first say 'hello'.
I have written a simple form handler which works on my testing server; when I deploy to my client's GoDaddy server the message fails.
I have contacted GoDaddy's support and have been told the following:
"If you use the mail() function in your PHP, you do not need to specify an outgoing mail server. If you are using some other method besides mail() in your PHP code, use relay-hosting.secureserver.net for your relay server."
I DO use the mail() function and do not specify an outgoing mail server...the following is my code:
I am truly throwing up a flare here. Any ideas?
I have written a simple form handler which works on my testing server; when I deploy to my client's GoDaddy server the message fails.
I have contacted GoDaddy's support and have been told the following:
"If you use the mail() function in your PHP, you do not need to specify an outgoing mail server. If you are using some other method besides mail() in your PHP code, use relay-hosting.secureserver.net for your relay server."
I DO use the mail() function and do not specify an outgoing mail server...the following is my code:
Code: Select all
<?php
$contact_name = $_POST['name'];
$contact_email = $_POST['email'];
$contact_phone = $_POST['phone'];
$contact_message = $_POST['message'];
if( $contact_name == true )
{
$sender = $contact_email;
$receiver = "me@somewhere.com";
$phone = $contact_phone;
$receiver2 = $contact_email;
$client_ip = $_SERVER['REMOTE_ADDR'];
$email_body = "Name: $contact_name \nEmail: $sender \n\nPhone: $phone\n\nMessage: \n\n$contact_message \n\nIP: $client_ip \n\n";
if( mail( $receiver, "Contacted via Web Site - $contact_subject", $email_body ))
{
echo "success=yes";
}
else
{
echo "success=no";
}
}
?>