Send mail using phpmailer
PHPMailer is easy system to send mail one to another from your PHP web page and it is a code library. It is so simple system to send emails with safely and easily via PHP or PHP code from a web server.
Every people whose use PHP and they are try to send mail using any mail system and many people have to face in a problem to send mail in PHP properly. There have a big solution for send mail and using mailing system in PHP so that you can use PHPMailer. It is one of the popular solutions for mail in PHP.
You know that PHPMailer sends an SMTP extension command with the sent emails in PHP. I will help you with example code. That is I gave you below in the page and follow the code:
<?php $subject ="Send Mail"; $receive_email = "Example@gmail.com"; $full_name=$_POST['full_name']; $phone=$_POST['phone']; $email=$_POST['email']; $address=$_POST['address']; $user_details="Full Name: ". $full_name. "\n Phone No: ". $phone."\n Address: ".$address; require_once("class.phpmailer.php"); $mail = new PHPMailer(); $body = "</pre> <div>"; $body .= "<p>Full Name :".$full_name."</p>"; $body .= "<p>Phone :".$phone."</p>"; $body .= "<p>Address :".$address."</p>"; $body .= "</div>" ; // And the absolute required configurations for sending HTML with attachement $mail->AddAddress("Example@gmail.com", "My Website Name"); $mail->Subject = "Send Mail"; $mail->MsgHTML($body); if(!$mail->Send()) { echo "There was an error sending the message"; exit; } echo "Thank you for contacting us!"; ?>
Related posts