3

The problem is really about host(smtp.fas.harvard.edu), I had the same problem and here is my decision: I created a new mailbox at gmail, and used it like this: /*Sends a message of $body with subject $subj to $to*/ function email($to, $subj, $body) { // create mail object and set some settings settings $mail = new PHPMailer(); $mail->...


3

You will have to figure out on your own how to get the user's address but if you want the code for how to send an email, you can use the phpmailer as described in a walkthrough video and here, and the relative code is as follows: the following code uses a gmail account to send the emails <?php require("libphp-phpmailer/class.phpmailer.php"); $...


2

Try this instead: $mail = new PHPMailer(); $body = "<h1>hello, world!</h1>" $mail->IsSMTP(); // telling the class to use SMTP $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "tls"; // sets the prefix to the servier $mail->Host = "smtp.gmail....


1

If you are using two step authentication for your Gmail account, you have to create a one time password and use this one, as you can't use the two step authentication with phpmailer.


1

I used single quotes and it works for me. Use single quotes for everything except email, password, body, and subject.


1

PHPMailer sends emails as plain text by default. You can enable HTML emails using IsHTML: $mail->IsHTML(true);


Only top voted, non community-wiki answers of a minimum length are eligible