PHP mailer

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
y.t.
Forum Newbie
Posts: 2
Joined: Tue Mar 09, 2010 9:35 pm

PHP mailer

Post by y.t. »

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:

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";
    }
}
?>
I am truly throwing up a flare here. Any ideas?
y.t.
Forum Newbie
Posts: 2
Joined: Tue Mar 09, 2010 9:35 pm

Re: PHP mailer

Post by y.t. »

* bump with home of getting some help
User avatar
jkraft10
Forum Newbie
Posts: 10
Joined: Sun Feb 14, 2010 8:00 pm
Location: Fontana, CA

Re: PHP mailer

Post by jkraft10 »

Code: Select all

if( $contact_name == true )
{
is $contact_name == true? is it a boolen? I assume not, so..

you may want to try:

Code: Select all

if($contact_name)
{
Post Reply