phpmailer

Gmail SMTP Can't Connect

懵懂的女人 提交于 2019-12-24 10:48:36
问题 I can't get Gmail SMTP to connect and I'm getting this debug info on tls: 2017-12-05 16:40:25 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP q9sm1085224pfl.116 - gsmtp 2017-12-05 16:40:25 CLIENT -> SERVER: EHLO localhost 2017-12-05 16:40:25 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [2405:204:d304:d69d:3c36:3d9:213e:186a]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8 2017-12-05 16:40:25 CLIENT -> SERVER: STARTTLS 2017-12-05 16:40

HTML mail with dyanmic values

拟墨画扇 提交于 2019-12-24 10:19:09
问题 Here is what I need to do. I need to be able to dynamically generate custom emails. I have been using PHP's mail() function, but I have been encouraged to try phpmailer or Zendmail. But it doesn't seem to be able to handle custom emails. What I need to do is be able to grab values from the form and insert them into the body of the message. I've been doing: $message = '<html><body><p>First name: ' $first . '<br/><br/>'; $message .= ...(rest of message) Then I do: mail($recipient, $subject,

PHPMailer, Fatal error: Call to a member function Send() on a non-object

吃可爱长大的小学妹 提交于 2019-12-24 09:25:29
问题 I get this error PHP Fatal error: Call to a member function Send() on a non-object . This error concerns the line if(!$mail->Send()) . I searched on another forum and it might be about using "load->" somewhere but I'm not sure why and how. function New_Mail($email,$firstname,$surname,$body, $subject, $altBody, $wordwrap){ $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // sets the prefix to the server $mail->Host =

Can not send mail through PHPMailer

寵の児 提交于 2019-12-24 05:41:11
问题 This is my php code require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "smtp.gmail.com"; // SMTP server $mail->From = "example@gmail.com"; $mail->AddAddress("example@yahoo.com"); $mail->Subject = "First PHPMailer Message"; $mail->Body = "Hi! \n\n This is my first e-mail sent through PHPMailer."; $mail->WordWrap = 50; if(!$mail->Send()) { echo 'Message was not sent.'; echo 'Mailer error: ' . $mail->ErrorInfo; } else { echo

PHP Mailer shows no errors but doesn't send the email

非 Y 不嫁゛ 提交于 2019-12-24 03:51:24
问题 I'm creating a booking form as a favour but have decided to send mail via the domain, not the server. This is mainly for better security and less limits in responses and data transfers. I've been working on this for the last few days and trying to teach myself how to get it to work. I now have a very simple working example which can be seen here below. This is the simple booking form: <form method="post" name="process.php" action="process.php"> <p>Name:</p><br><input type="text" name="name">

Add a filetype validation to phpmailer?

回眸只為那壹抹淺笑 提交于 2019-12-24 02:39:07
问题 I have a phpmailer that attaches files by looping through an array of files from an file input field. How can i make it so that onl PDF or DOC are allowed. And if something else is attempted, the script stope and gives an error: "File type not supported. Only PDF or DOC." Any suggestions? Heres my current script; foreach(array_keys($_FILES['files']['name']) as $key) { $source = $_FILES['files']['tmp_name'][$key]; $filename = $_FILES['files']['name'][$key]; $mail->AddAttachment($source,

AWS SES with PHPMailer using SMTP, SMTP Error: Could not authenticate?

风格不统一 提交于 2019-12-24 00:58:08
问题 I get the following error: Authentication Credentials Invalid. I've double checked the username (Access key ID) and password (Secret Token) a million times. I double checked the base64 sent to the server and it's correct. User has correct access rights. All outbound traffic from EC2 server is allowed. SELinux is disabled. I've escaped special characters, tried different credentials. Tried using a user with more access. I'm using PHPMailer with AWS SES. Here is the code: $mail = new PHPMailer;

PHPMailer - send PHP generated PDF (mPDF) as attachment

房东的猫 提交于 2019-12-23 21:58:52
问题 I know how to generate PDF using mPDF library and send it as attachment using PHPMailer - something like this: ... $emailAttachment = $mpdf->Output('file.pdf', 'S'); $mail = new PHPMailer(); $mail->AddStringAttachment($emailAttachment, 'file.pdf', 'base64', 'application/pdf'); ... But what if I generate PDF in separate PHP file (that should not be modified) - like this - invoice.php: ... $mpdf = new mPDF(); $mpdf->WriteHTML($html); $mpdf->Output(); exit; How can I attach this dynamically

extra newlines in plain text emails sent via sendgrid

纵然是瞬间 提交于 2019-12-23 20:32:41
问题 We send emails in plain text from PHP using CodeIgniter (v1.7) and also PHPMailer (v5.1). Current production setup uses a cheapie SMTP relay, plan is to switch to a CritSend or SendGrid. We are testing the options now from a Rackspace Cloud server. When we use SendGrid SMTP all "\r\n" newlines in the emials end up being doubled up, so end up as "\r\n\r\n". All works fine when using CritSend SMTP and also two other SMTP servers. SendGrid tech support don't think it is anything to do with their

Codeigniter 3: send account activation email fails

给你一囗甜甜゛ 提交于 2019-12-23 18:27:38
问题 I am working on a Register and Login application with CodeIgniter 3 and Twitter Bootstrap. When a user registers , an email should be send to the address he/she provided, with an account confirmation link . The problem is that the confirmation email does not send . In the Usermodel I have: public function activationEmail($first_name='', $last_name='', $email='', $verification_key='') { $this->load->library('email'); $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'smtp.code-love.tk',