Jump to content

How to set up PHP with Yahoo Small Business.


devzin98

Recommended Posts

Hello, everyone.  I'm still kind of new at this, so please bear with me.

 

I've customized a website (hosted by Yahoo Small Business) which is now fully functional aside from the "Contact Us" page.  I have a PHP file named "send_email.php" uploaded to my root directory which has the following code:

 

<?php

$contact_name = $_POST['name'];

$contact_email = $_POST['email'];

$contact_subject = $_POST['subject'];

$contact_message = $_POST['message'];

 

if( $contact_name == true )

{

$sender = $contact_email;

$receiver = "[email protected]";

$client_ip = $_SERVER['REMOTE_ADDR'];

$email_body = "Name: $contact_name \nEmail: $sender \n\nSubject: $contact_subject \n\nMessage: \n\n$contact_message \n\nIP: $client_ip \n\nFlash Contact Form provided by http://www.flashmo.com";

$extra = "From: $sender\r\n" . "Reply-To: $sender \r\n" . "X-Mailer: PHP/" . phpversion();

 

if( mail( $receiver, "Flash Contact Form - $contact_subject", $email_body, $extra ) )

{

echo "success=yes";

}

else

{

echo "success=no";

}

}

?>

 

 

I went ahead and changed "[email protected]" to my actual email address.  The problem I'm having, though, is that the form fails every time...except if I enter my own email address in the "Email" field which should be filled in by the customer.  I can't figure this out.  It's probably something simple that I'm doing wrong, or perhaps it has something to do with Yahoo Web Hosting.  I'm also thinking I have to fill something in the "Client IP" section of the code...but I'm not sure what should go there.

 

I'd really appreciate your time and responses.  Thanks so much.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.