swiftmailer

How to use the swiftMailer in Yii2

江枫思渺然 提交于 2019-11-27 17:59:14
I can't finally understand how to use the swiftMailer extension in Yii2. Judging by that on this subject I didn't find questions, the task is trivial, but up to the end I couldn't understand. There are examples which don't describe in more detail all cycle of sending the letter or I don't understand something :( Setup return [ //.... 'components' => [ ...... 'mail' => [ 'class' => 'yii\swiftmailer\Mailer', 'transport' => [ 'class' => 'Swift_SmtpTransport', 'host' => 'localhost', 'username' => 'username', 'password' => 'password', 'port' => '587', 'encryption' => 'tls', ], ], ] ]; Send Yii::

Using gmail smtp via Laravel: Connection could not be established with host smtp.gmail.com [Connection timed out #110]

試著忘記壹切 提交于 2019-11-27 14:41:20
When I try to use GMail SMTP for sending email via Laravel, I encounter the following error: Swift_TransportException Connection could not be established with host smtp.gmail.com [Connection timed out #110] It is the trace of the error: ... } $this->_stream = @stream_socket_client($host.':'.$this->_params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, stream_context_create($options)); if (false === $this->_stream) { throw new Swift_TransportException( 'Connection could not be established with host ' . $this->_params['host'] . ' [' . $errstr . ' #' . $errno . ']'... and here are my

Swift_TransportException Connection could not be established with host smtp.gmail.com

点点圈 提交于 2019-11-27 13:32:16
I can't figure for the life of me why exactly is it failing.. this is the exact error I am getting: Fatal error: Uncaught exception 'Swift_TransportException' with message 'Connection could not be established with host smtp.gmail.com [Connection refused #111]' in /home/content/38/6896038/html/test/lib/classes/Swift/Transport/StreamBuffer.php:259 Stack trace: #0 /home/content/38/6896038/html/test/lib/classes/Swift/Transport/StreamBuffer.php(64): Swift_Transport_StreamBuffer->_establishSocketConnection() #1 /home/content/38/6896038/html/test/lib/classes/Swift/Transport/AbstractSmtpTransport.php

Failed to authenticate on SMTP server error using gmail

牧云@^-^@ 提交于 2019-11-27 11:18:07
问题 I'm trying to set up email for my first laravel project, and was thrilled that there's a laracast for it: https://laracasts.com/lessons/mailers I've followed the simple steps, chose gmail in mail.php (x's added for anonymity): 'driver' => env('MAIL_DRIVER', 'smtp'), 'host' => env('MAIL_HOST', 'smtp.gmail.com'), 'port' => env('MAIL_PORT', 587), 'from' => ['address' => 'dianexxxxx@gmail.com', 'name' => 'Diane Kaplan'], 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 'username' => 'dianexxxxx

Configure Symfony2/Swiftmailer to use “sendmail -t”

本秂侑毒 提交于 2019-11-27 08:03:03
问题 I'm currently trying to get Symfony2/Swiftmailer to send the contents of a submitted form via mail. My parameters.yml contains the following: mailer_transport: sendmail mailer_host: ~ mailer_user: ~ mailer_password: ~ Since the sendmail version on my server does not support the -bs option, which Swiftmailer seems to use by default, I have to find a way to tell Symfony2/Swiftmailer to use sendmail -t instead. Swift_Transport_SendmailTransport seems to support that, but there doesn't seem to be

Laravel email with queue 550 error (too many emails per second)

感情迁移 提交于 2019-11-27 07:42:32
问题 Our emails are failing to send using Laravel with a Redis Queue. The code that triggers the error is this: ->onQueue('emails') $job = (new SendNewEmail($sender, $recipients))->onQueue('emails'); $job_result = $this->dispatch($job); In combination with this in the job: use InteractsWithQueue; Our error message is: Feb 09 17:15:57 laravel: message repeated 7947 times: [ production.ERROR: exception 'Swift_TransportException' with message 'Expected response code 354 but got code "550", with

trying to send mail using swift mailer, gmail smtp, php

▼魔方 西西 提交于 2019-11-27 06:41:10
Here is my code: <?php require_once 'Swift/lib/swift_required.php'; $transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465) ->setUsername('me@ff.com') ->setPassword('pass'); $mailer = Swift_Mailer::newInstance($transport); $message = Swift_Message::newInstance('Wonderful Subject') ->setFrom(array('me@ff.com' => 'MY NAME')) ->setTo(array('you@ss.com' => 'YOU')) ->setBody('This is the text of the mail send by Swift using SMTP transport.'); //$attachment = Swift_Attachment::newInstance(file_get_contents('path/logo.png'), 'logo.png'); //$message->attach($attachment); $numSent =

Address in mailbox given [] does not comply with RFC 2822, 3.6.2. when email is in a variable

。_饼干妹妹 提交于 2019-11-27 03:52:29
问题 I have a correct email address. I have echoed it, but when I send it, I get the following error: Address in mailbox given [] does not comply with RFC 2822, 3.6.2. Why? I use laravel (swift mailer) to send email: $email = email@address.com and then when I send it, the error is thrown. But if I directly use the string, it sends it. Here is the block: Mail::send('emails.activation', $data, function($message){ $message->to($email)->subject($subject); }); ->with('title', "Registered Successfully."

Expected response code 220 but got code “”, with message “” in Laravel

人走茶凉 提交于 2019-11-27 00:50:22
I am using Laravel Mail function to send email. The following is my app/config/mail.php file settings. 'driver' => 'sendmail', 'host' => 'smtp.gmail.com', 'port' => 587, 'from' => array('address' => 'email@gmail.com', 'name' => 'MyName'), 'encryption' => 'tls', 'username' => 'myUsername', 'password' => "password", 'sendmail' => '/usr/sbin/sendmail -bs', 'pretend' => false, Controller Mail Method //Send Mail Mail::send('sendMail', array('key' => 'value'), function($message) { $message->to('EmailId@hotmail.com', 'Sender Name')->subject('Welcome!'); }); When I run the code it gives me following

Tracking email bounces, opens, clicks

半世苍凉 提交于 2019-11-26 22:40:32
问题 I found How do you make sure email you send programmatically is not automatically marked as spam? to (hopefully) be a solid guide to avoiding being marked as spam. Are there any other important tips/suggestions? How do I track bounces,opens,clicks? These are features found in paid services like Mail Chimp and Campaign Monitor. 回答1: Do the same as Mail Chimp and Campaign Monitor then. LIE about your stats. There is no accurate way to track emails. If there was it'd just get blocked again. Most