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 = "my@email.com";

$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 "my@email.com" 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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.