swiftmailer

Laravel mail sent but still throws exception

◇◆丶佛笑我妖孽 提交于 2019-12-24 20:17:36
问题 I am sending an email in laravel like this: Mail::send('email.email_view', [] , function($message) { $message->to('email@gmail.com', 'Receiver Name') ->subject('TTTTTT'); }); The view "email.email_view" only contains this: test this What happens is that the email gets sent and I receive it in the inbox, but still it throws this exception: local.ERROR: Connection to tcp://mail.myserver.net:2525 Timed Out {"exception":"[object] (Swift_TransportException(code: 0): Connection to tcp://mail

Error trying to send email through Gmail using SwiftMailer

断了今生、忘了曾经 提交于 2019-12-24 10:58:32
问题 I'm following Symfony 3 Documentation to send an email from my controller, but I'm getting an error. I made sure to follow each step from the above page correctly, but no use. This is how my controller looks like: <?php namespace MyBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Component\HttpFoundation\Response; class DefaultController extends Controller { /** * @Route("/") */ public function

How to configure Monolog to send errors via SwiftMailer to alternate mailer in Symfony2

隐身守侯 提交于 2019-12-24 04:56:07
问题 In my symfony2 application I have two mailers, and I'd like to use the non-default mailer to send monolog errors. Errors are being sent as expected now, but I can't get it to send to the non default mailer. Here's my Swift Mailer configuration, in which I'd like to send errors using the "phpmail" mailer: Swiftmailer Configuration default_mailer: authsmtp mailers: authsmtp: transport: %mailer_transport% host: %mailer_host% username: %mailer_user% password: %mailer_password% port: %mailer_port%

Laravel 4 from contact form to admin email

房东的猫 提交于 2019-12-24 01:57:16
问题 I'm trying to use Laravel's Mail class for the first time and am having some difficulties. I have a simple contact form that should be sent as an email to the admin. Here is what I have tried Controller (Will be refactored into Model once I can get it working) public function store() { $validation = new Services\Validators\Contact; if($validation->passes()) { $fromEmail = Input::get('email'); $fromName = Input::get('name'); $subject = "Email from user at website.com"; $data = Input::get(

Attempted to call an undefined method named “getRequest” of class . Sendind e-mail in SwiftMailer Symfony

☆樱花仙子☆ 提交于 2019-12-24 01:16:08
问题 I'm trying to sen an e-mail by SwiftMailer in Symfony 3. I'm going through that tutorial: http://tutorial.symblog.co.uk/docs/validators-and-forms.html#sending-the-email and I've got the problem in "Creating the form in the controller" : "Attempted to call an undefined method named "getRequest" of class "AppBundle\Controller\DefaultController". " That's my contactAction() in src/AppBundle/DeffaultController: /** * @Route("/contact"), name="cont") */ public function contactAction() { $enquiry =

Does anyone have recommendations for a good (and lightweight!) PHP mailer library?

狂风中的少年 提交于 2019-12-24 00:49:40
问题 Pretty much as the title says. I'm currently using the SwiftMailer (http://swiftmailer.org), but I'm just wondering how it stacks up to the other libraries out there. 回答1: Not sure about libraries like PHPMailer, Swiftmailer, HTMLMimeMail (I've used this one for a couple of projects in the past ; never had any problem with it) or the like, but I think, for a project of my own, I'd have a look at Zend_Mail Why ? I see at least two reasons : Zend Framework's components are well written, well

PHP SwiftMailer or PEAR Mail

爷,独闯天下 提交于 2019-12-23 23:17:29
问题 Does someone have some comments about those two? in terms of experience, performance, easiness, problems, spam related, etc. Say you need to send emails (10-20) every 1 hour (cron job). 回答1: I'd go with SwiftMailer. I've used both and Swiftmailer has imho the best API and support. Also SwiftMailer maintenance has been adopted by Fabien Potencier of Symfony fame which only means that it'll improve over time. Pear Mail is also under developement but not really active. In terms of functionality

Swift_RfcComplianceException on valid email address, works in Windows not in Ubuntu

自古美人都是妖i 提交于 2019-12-23 16:31:02
问题 I'm running into what appears to be a rather infamous issue with SwiftMailer: Fatal error: Uncaught exception ‘Swift_RfcComplianceException’ with message ‘Address in mailbox given [noreply@host.com] does not comply with RFC 2822, 3.6.2.’ The message is being created with the following code (effectively): $message = \Swift_Message::newInstance() ->setSubject('Subject') ->setFrom(array('noreply@host.com' => 'Host')) ->setTo('recipient@gmail.com'); ... The odd thing is that the address: noreply

Swiftmailer won't send mail, but mail() will

妖精的绣舞 提交于 2019-12-23 15:08:26
问题 PHP's mail() function sends mail fine, but Swiftmailer's Swift_MailTransport doesn't work! This works: mail('user@example.com', 'test '.date('H:i:s'), ''); But this does not: $transport = Swift_MailTransport::newInstance(''); $mailer = Swift_Mailer::newInstance($transport); $message = Swift_Message::newInstance('test '.date('H:i:s')) ->setFrom('user@example.com') ->setTo('user@example.com') ->setBody('Testing one two three'); $result = $mailer->send($message); (The user@example.com is

Why is SwiftMailer sending two emails?

风格不统一 提交于 2019-12-23 14:41:55
问题 I am sending emails via PHP's SwiftMailer library. I have this PHP code to send 1 email to 1 email recipient from 1 sender. Here is the code: $email = /*some email recipient*/; $sendEmail = /*sender's email*/; $sendName = /*sender's name*/; $subject = /*email subject*/; $body = /*email body*/; //Create the message //Create the Transport $transport = Swift_SmtpTransport::newInstance('/*mail host*/', /*port*/) ->setUsername('/*some username*/') ->setPassword('/*some password*/') ; //Create the