how can we use google smtp server to send mail using php
here's my current php script
here's my current php script
Code:
<?php $toName = "my name"; $toEmail = "myemail@example.org"; $subject = "success"; $name = $_POST["name"]; $email = $_POST["email"]; $headers = "From: Your Name <myemail@example.org>" . "\r\n"; $headers .= "Reply-To: Your Name <myemail@example.org>" . "\r\n"; $headers .= "X-Mailer: PHP/" . phpversion(); $message= "name: $name email: $email "; $replySubject = "Mail from me"; $replyMessage = "I will reply to your query soon"; // send email to You // mail($toName." <".$toEmail.">", $subject, $message, "From: ".$name." <".$email.">"); // send email to You // print "process=complete"; // send reply email to inquirer // mail ($name." <".$email.">", $replySubject, $replyMessage, $headers); // send reply email to inquirer // ?>
Comment