Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(!$mail->send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- } else {
- echo 'Message has been sent';
- }
- <?php
- require 'C:wampwwwphpmailerPHPMailer-masterPHPMailerAutoload.php';
- $mail = new PHPMailer;
- if (isset($_POST['submit'])) {
- //$mail->SMTPDebug = 3; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.gmail.com '; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'test@gmail.com'; // SMTP username
- $mail->Password = 'password'; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 587; // TCP port to connect to
- $mail->setFrom('from@example.com', 'Mailer');
- $mail->addAddress('tester@gmail.com', 'Marco'); // Add a recipient
- //$mail->addAddress('ellen@example.com'); // Name is optional
- //$mail->addReplyTo('info@example.com', 'Information');
- //$mail->addCC('cc@example.com');
- //$mail->addBCC('bcc@example.com');
- $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
- $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'NEW APPLICATION';
- $mail->Body = "--PERSONAL INFORMATION--
- First Name: $fname Middle Name: $mname Last Name: $lname
- Address:$address City:$city State:$state Zip:$zip ";
- //$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- }
- ?>
- <input type="hidden" name="submit" value="foo" />
- <input type="submit" value="Submit!" name="submit" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement