Question:
can someone help me send an email using PHP?
Steven Lu
2013-06-18 09:06:38 UTC
I went on w3schools.com on this link: http://w3schools.com/php/php_secure_mail.asp
I copied the code exactly as it is. However, after I fill in everything, the button does nothing. Any help?
Four answers:
anonymous
2013-06-18 11:16:20 UTC
PHP: Sending Email Tutorial (Text/HTML/Attachments): http://www.webcheatsheet.com/php/send_email_text_html_attachment.php

How to Code a Sign Up Form with Email Confirmation: http://net.tutsplus.com/tutorials/php/create-a-signup-form-with-email-confirmation/

Quick Tip: How to create editable form fields: http://tv.adobe.com/watch/acrobat-x-tips-tricks/quick-tip-how-to-create-editable-form-fields/



CoffeeCup Free Web Form Builder (Win/Mac Versions): http://www.coffeecup.com/web-form-builder-lite/



Use any of the below sites to make the workable form you need (Just follow the instructions for making it and uploading file(s)):



Contact Form Generator: http://www.tele-pro.co.uk/scripts/contact_form/

http://www.thesitewizard.com/wizards/feedbackform.shtml (easy to use)

http://www.reconn.us/content/view/12/34/ (Download - Contact Us Script)

http://www.form2email.net/

Online Free Tool, PHP Contact Form Code Generator: http://www.htmlbasix.com/contactform.shtml



Ron
anonymous
2013-06-18 09:23:59 UTC
the php function to send an email is



mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )



Since your button click is not working you are not handling your email form correctly

try something like

















and then in your php check




$to = $_POST['to'];

$subject = $_POST['subject'];

$message = $_POST['message'];



if(isset($_POST['send_button']){



// do your mail

mail($to, $subject, $message);

}

?>



This is a very simple version. It is extremely insecure as far as what the user inputs. May want to think about using regular expressions to check if the to is actually an email and may want to strip out slashes etc.
?
2016-12-29 18:02:55 UTC
What you're describing is a robust recipe for procuring the comprehensive area call tagged as a spammer, and having all of the emails you deliver ending up on your recipient's "Bulk Mail" folder (if in any respect). except you're in basic terms permitting registered shoppers to deliver mail, or you have have been given a great sort of sorting out algorithms in place to circumvent the hacking of the type.
Tech
2013-06-18 09:23:26 UTC



if (isset($_POST['Submit'])) {



$youremail = 'mailid here';



$fromsubject = 'subject here';



$fname = $_POST['fname'];



$mail = $_POST['mail'];



$phone = $_POST['phone'];







$message = $_POST['message'];



$to = $youremail;



$mailsubject = 'Masage recived from' . $fromsubject . ' Contact Page';



$body = $fromsubject . '







The person that contacted you is ' . $fname . '



Phone Number: ' . $phone . '



E-mail: ' . $mail . '











Message:



' . $message . '







|---------END MESSAGE----------|';



echo "Thank you!!!. I should contact you shortly ";



mail($to, $mail, $body);



} else {



echo "You must write a message.";



}



?>





























  























This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...