swiftmailer

Yii2 SwiftMailer sending email via remote smtp server (gmail)

假如想象 提交于 2020-04-13 18:35:22
问题 I want to send emails via my gmail account. My mailer config: [ 'class' => 'yii\swiftmailer\Mailer', 'useFileTransport' => false,//set this property to false to send mails to real email addresses 'transport' => [ 'class' => 'Swift_SmtpTransport', 'host' => 'smtp.gmail.com', 'username' => 'my@gmail.com', 'password' => 'pass', 'port' => '587', 'encryption' => 'tls', ], ] I wrote command MailController: <?php namespace app\commands; use yii\console\Controller; use Yii; /** * Sanding mail * Class

使用GMail SMTP服务器从PHP页面发送电子邮件

僤鯓⒐⒋嵵緔 提交于 2020-02-26 11:10:25
我正在尝试从PHP页面通过GMail的SMTP服务器发送电子邮件,但出现此错误: 身份验证失败[SMTP:SMTP服务器不支持身份验证(代码:250,响应:mx.google.com,为您提供服务,[98.117.99.235]大小为35651584 8位MIME STARTTLS ENHANCEDSTATUSCODES PIPELINING)] 有人可以帮忙吗? 这是我的代码: <?php require_once "Mail.php"; $from = "Sandra Sender <sender@example.com>"; $to = "Ramona Recipient <ramona@microsoft.com>"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; $host = "smtp.gmail.com"; $port = "587"; $username = "testtest@gmail.com"; $password = "testtest"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'port' =

How can i get full url to include in newsletter sent with Symfony2?

自作多情 提交于 2020-01-29 02:44:36
问题 I'm going to use Symfony2 to sent periodically a newsletter to many users. I've to include a permalink to the HTML email for those who experience problems in reading them with an email client. Anyway, assuming that i'm sending the newsletter this way: // Assume success and create a new SentMessage to store and get permalink $sent = new SentMessage(); $sent->setRecipients(/* ... */); $sent->setSubject(/* ... */); $sent->setContent(/* ... */); // Get the slug for the new sent message $slug =

How can i get full url to include in newsletter sent with Symfony2?

只谈情不闲聊 提交于 2020-01-29 02:44:08
问题 I'm going to use Symfony2 to sent periodically a newsletter to many users. I've to include a permalink to the HTML email for those who experience problems in reading them with an email client. Anyway, assuming that i'm sending the newsletter this way: // Assume success and create a new SentMessage to store and get permalink $sent = new SentMessage(); $sent->setRecipients(/* ... */); $sent->setSubject(/* ... */); $sent->setContent(/* ... */); // Get the slug for the new sent message $slug =

How do we solve error 554 5.5.1 (no valid recipients) when using PHP Swiftmailer?

僤鯓⒐⒋嵵緔 提交于 2020-01-24 20:16:19
问题 When testing out our mail server we stumbled accross an error that prevents us from sending mails via PHP, though regular sending/receiving per Mail-in-a-box works without any problems. We are running a separate Ubuntu 18.04 server that only has Mail-in-a-box with all its needed components running. Output in the error.log text file PHP Fatal error: Uncaught Swift_TransportException: Expected response code 354 but got code "554", with message "554 5.5.1 Error: no valid recipients\r\n" PHP file

Fatal error when trying to send email using SwiftMailer and Sendgrid

蹲街弑〆低调 提交于 2020-01-24 10:31:06
问题 I'm getting this error when trying to send an email using swiftmailer and the sendgrid smtp Fatal error: *Uncaught exception 'Swift_TransportException' with message 'Expected response code 250 but got code "", with message ""'* Here's my code : $hdr = new SmtpApiHeader(); // Set all of the above variables $hdr->addTo($toList); $hdr->addSubVal('-name-', $nameList); $hdr->addSubVal('-time-', $timeList); // Specify that this is an initial contact message $hdr->setCategory("initial"); // The

Laravel 5.5 - mail not working with `mail` driver

拜拜、爱过 提交于 2020-01-24 10:14:11
问题 Ob my Laravel setup, mail was always working until I upgraded the framework to 5.5 (from 5.4). Now it always fail at the following: Do note the following: mail server on local env = http://www.toolheap.com/test-mail-server-tool/users-manual.html ive used this like since 5yrs (this is a one-click-install/no-dramas/no-config/no-error test mail server) and till yesterday it worked so im NOT changing it to something else The php's mail() function works if called directly The mail driver ive set

Symfony2, send mail to gmail

我与影子孤独终老i 提交于 2020-01-16 04:50:11
问题 I want to intercept all email send by Symfony2. I configure swiftmailer like that: swiftmailer: delivery_address: my@gmail.com #My gmail addr transport: gmail username: my@gmail.com#I use my gmail for easy smtp configuration (just for dev) password: mypassword I receive no emails. I'm developping on Windows10 and i use Wamp. 回答1: I guess you in dev mode, so you need to do this in you config_dev file: # app/config/config_dev.yml swiftmailer: disable_delivery: false delivery_address: dev

laravel send mail on server with gmail not working

ε祈祈猫儿з 提交于 2020-01-15 06:28:07
问题 hi in my laravel application im sending mail when i create a new user !! so in localhost i use gmail smtp with my gmail account and username and it's working but on the server i got this error Swift_TransportException Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 http://support.google.com/mail/bin/answer.py?answer=14257 pn5sm18998642wjc.4 - gsmtp " here is my code if ($user->save()) { View::composer('emails

Send mail through smtp.gmail.com in symfony 2 using swiftmailer

牧云@^-^@ 提交于 2020-01-13 10:08:56
问题 I am having a trouble of sending mail from xampp localhost using gmail. And after a long time I finally successful on it. And I am sharing it with all you. If I am wrong need proper solution for it. in config.yml of your symfony 2 Write those swiftmailer: disable_delivery: false transport: %mailer_transport% host: %mailer_host% username: %mailer_user% password: %mailer_password% port: %mailer_port% encryption: %mailer_encryption% In your parameters.yml mailer_transport: smtp mailer_host: smtp