Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('class.phpgmailer.php');
- $mail = new PHPGMailer();
- $mail->Username = 'username@gmail.com';
- $mail->Password = '********';
- $mail->From = 'username@gmail.com';
- $mail->FromName = "<blah>";
- $mail->Subject = 'something';
- $mail->AddAddress('xyz@gmail.com');
- $mail->Body = "Hello Sir"."n"."
- Your Password is : ."."";
- $mail->Host = 'smtp.gmail.com';
- $mail->Port = 465;
- $mail->Send();
- if(!$mail->Send())
- {
- echo 'Message could not be sent.' ;
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- exit;
- }
- echo 'Message has been sent';
- require("phpmailer/class.phpmailer.php");
- $mail = new PHPMailer();
- $mail->IsSMTP();
- $mail->SMTPAuth = true;
- $mail->Host = "ssl://smtp.gmail.com";
- $mail->Port = 465;
- $mail->Username = "from@gmail.com";
- $mail->Password = "****";
- $mail->FromName = "Sender name";
- $mail->Subject = "test";
- $mail->Body = "Test body";
- $mail->AddAddress('sender@mail.com');
- if(!$mail->Send()){
- echo "Mailer Error: " . $mail->ErrorInfo;
- }else{
- echo "Message has been sent";
- }
- $mail->IsSMTP(); // enable SMTP
- $mail->SMTPDebug = 0; // debugging: 1 = errors and messages, 2 = messages only
- $mail->SMTPAuth = true; // authentication enabled
- $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
- $mail->Host = 'smtp.gmail.com';
- $mail->Port = 465;
- $mail->Username = 'email@gmail.com';
- $mail->Password = 'password';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement