Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include "PHPMailer_5.2.4/class.phpmailer.php";
- $mail = new PHPMailer();
- $mail->IsSMTP();
- $mail->SMTPDebug = 1;
- $mail->SMTPAuth = true;
- $mail->SMTPSecure = 'ssl';
- $mail->Host = "smtp.gmail.com";
- $mail->Port = 465;
- $mail->IsHTML(true);
- $mail->Username = "nida.office123@gmail.com";
- $mail->Password = "*************";
- $mail->AddAddress($to,$nameM );
- $mail->Subject = "Payment Request";
- $mail->Body = "<b>A payment request has been made. Please visit your panel and accept or disapprove the request.Visit the link below to perform the action. <center><a href="http://localhost/internshippro/login.php">Login to continue</a></center></b>";
- $text = 'Text version of email';
- $html = '<html><body>HTML version of email</body></html>';
- $file = 'index.php';
- $crlf = "n";
- $hdrs = array(
- 'email' => 'example@gmail.com',
- 'Subject' => 'Test subject message',
- 'comment' => 'Test comment',
- );
- if ($mail->send($hdrs))
- //if (mail($subject,$message, $headers))
- {
- echo "<script> alert('Thank you for contacting us!');window.location = '';</script>";
- } else {
- echo "Mailed Error: " . $mail->ErrorInfo;
- }
- SMTP -> ERROR: Failed to connect to server: (0)
- The following From address failed: root@localhost : Called Mail() without
- being connected Mailed Error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement