Jump to content

php contact form


ag4nt0range

Recommended Posts

could some someone please help me add remote and local smtp server support to this php 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;

//Put your email below

$receiver = "[email protected]";

 

$email_body = "Name: $contact_name \nEmail: $sender \n\nSubject: $contact_subject \n\nMessage: \n\n$contact_message";

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

 

if( mail( $receiver, "Mail form my Contact Form", $email_body, $extra ) )

{

echo "success=yes";

}

else

{

echo "success=no";

}

}

?>

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/200703-php-contact-form/
Share on other sites

  • 2 weeks later...

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.