Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include('PHPMailer-master/src/PHPMailer.php');
- $mail = new PHPMailer;
- // $mail->IsSMTP(); // telling the class to use SMTP
- $mail->Host = "mail.lyflinx.com"; // SMTP server
- $mail->SMTPDebug = 0;
- $mail->SMTPAuth = true;
- $mail->SMTPSecure = "tls";
- $mail->Host = "no-reply@lyflinx.com";
- $mail->Port = 465;
- $mail->IsHTML(true);
- $mail->Username = "no-reply@lyflinx.com"; // GMAIL username
- $mail->Password = "ZAINhandsom123"; // GMAIL passwordMAIL password
- $mail->SetFrom('no-reply@lyflinx.com', 'Attached Files');
- $mail->Subject = "PHP Sample Send Email";
- // $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
- $mail->MsgHTML($email_message);
- $address = "danish.172@gmail.com";
- $mail->AddAddress($address, $fname." ".$lname);
- // $mail->AddAttachment($_FILES['file']['tmp_name'], $_FILES['file']['name']); // attachment
- if (!$mail->Send()) {
- /* Error */
- echo 'Message not Sent! Email at '.$address;
- } else {
- /* Success */
- echo 'Sent Successfully! Check your Mail';
- }
- Response
- Message not Sent! Email at danish.172@gmail.co
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement