phpmailer: Reply using only “Reply To” address

I have found the answer to this, and it is annoyingly/frustratingly simple! Basically the reply to addresses needed to be added before the from address as such: $mail->addReplyTo(‘replyto@email.com’, ‘Reply to name’); $mail->SetFrom(‘mailbox@email.com’, ‘Mailbox name’); Looking at the phpmailer code in more detail this is the offending line: public function SetFrom($address, $name=””,$auto=1) { $address = trim($address); … Read more

PHPMailer – SMTP ERROR: Password command failed when send mail from my server

A bit late, but perhaps someone will find it useful. Links that fix the problem (you must be logged into google account): https://security.google.com/settings/security/activity?hl=en&pli=1 https://www.google.com/settings/u/1/security/lesssecureapps https://accounts.google.com/b/0/DisplayUnlockCaptcha Some explanation of what happens: This problem can be caused by either ‘less secure’ applications trying to use the email account (this is according to google help, not sure how … Read more

Send File Attachment from Form Using phpMailer and PHP

Try: if (isset($_FILES[‘uploaded_file’]) && $_FILES[‘uploaded_file’][‘error’] == UPLOAD_ERR_OK ) { $mail->addAttachment($_FILES[‘uploaded_file’][‘tmp_name’], $_FILES[‘uploaded_file’][‘name’]); } A basic example attaching multiple file uploads can be found here. The function definition for addAttachment is: /** * Add an attachment from a path on the filesystem. * Never use a user-supplied path to a file! * Returns false if the file … Read more

Unable to send email using Gmail SMTP server through PHPMailer, getting error: SMTP AUTH is required for message submission on port 587. How to fix?

$mail = new PHPMailer(); // create a new object $mail->IsSMTP(); // enable SMTP $mail->SMTPDebug = 1; // 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; // or 587 $mail->IsHTML(true); $mail->Username = “email@gmail.com”; $mail->Password … Read more

PHP mailer multiple address [duplicate]

You need to call the AddAddress method once for every recipient. Like so: $mail->AddAddress(‘person1@domain.example’, ‘Person One’); $mail->AddAddress(‘person2@domain.example’, ‘Person Two’); // .. Better yet, add them as Carbon Copy recipients. $mail->AddCC(‘person1@domain.example’, ‘Person One’); $mail->AddCC(‘person2@domain.example’, ‘Person Two’); // .. To make things easy, you should loop through an array to do this. $recipients = array( ‘person1@domain.example’ => … Read more

Configure WAMP server to send email

Configuring a working email client from localhost is quite a chore, I have spent hours of frustration attempting it. I’m sure someone more experienced may be able to help, or they may perhaps agree with me. If you just want to test, here is a great tool for testing mail locally, that requires almost no … Read more

Getting error while sending email through Gmail SMTP – “Please log in via your web browser and then try again. 534-5.7.14” [closed]

I know this is an older issue, but I recently had the same problem and was having issues resolving it, despite attempting the DisplayUnlockCaptcha fix. This is how I got it alive. Head over to Account Security Settings (https://www.google.com/settings/security/lesssecureapps) and enable “Access for less secure apps”, this allows you to use the google smtp for … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)