Questions tagged [swiftmailer]

Swift Mailer is a library that integrates into any web app written in PHP, offering a flexible and elegant object-oriented approach to sending emails with a multitude of features.

Swift Mailer is a library that facilitates sending email in PHP.

Benefits over the native mail() function include the use of , , or a custom transport layer, support for servers that require authentication, prevention of header injection attacks, support for attachments and more.


Documentation :

1670 questions
11
votes
1 answer

Silex SwiftMailer Not Making SMTP Connection Upon Execution

I am making a console application which uses the SwiftMail extension to send. Due to our policy, I have two virtual machines, one which serves as a SMTP relay and the other which is the application server. Sending mail manually through telnet to the…
Mike Mackintosh
  • 13,917
  • 6
  • 60
  • 87
11
votes
2 answers

how to add an attachment to an email in Symfony?

I want to add an attachment to an email. I am using sfmailer class. Here I have given my code below: $mail_body = '

custom html mail content

'; $message = Swift_Message::newInstance('Message title') ->setFrom(array('sender')) …
nic
  • 929
  • 3
  • 14
  • 22
10
votes
2 answers

How to change the name text of sender when sending mail with Swift_Message?

I am using SwiftMailer to send emails from my application. All is working fine so far. I now need to be able to change the text of the sender dynamically. The code snippet below and the next paragraph should hopefully clarify what I mean. Currently,…
oompahloompah
  • 9,087
  • 19
  • 62
  • 90
10
votes
2 answers

Catch swiftmailer exception in Symfony2 dev env controller

Im not sure why Im not catching exceptions from Swiftmailer in my controller. What am I doing wrong, or missing? In a controller I have: try { $this->get('mailer')->send($email); } catch (\Swift_TransportException $e) { $result = array( …
petesiss
  • 994
  • 13
  • 30
9
votes
7 answers

Can I use Amazon's SES with Symfony2 and the Swiftmailer Bundle?

I'm hosting a site on Amazon's ec2 running a 64-bit version of CentOS. The site has a simple Contact Us form that needs to send an email to several addresses when submitted (pretty basic). Has anyone used Amazon's SES with Symfony2 and the…
user843058
  • 139
  • 1
  • 2
  • 8
9
votes
3 answers

swift mailer send to queue for later delivery

When using http://swiftmailer.org can I send a message to the mail queue so that php returns right away instead of actually sending the message right now?
crickeys
  • 3,075
  • 3
  • 26
  • 27
9
votes
2 answers

Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead

I can't install breez and npm for this situation. What should I do to solve this problem? When I'm going to create a laravel project show this and breez install time too.
Rajib Bin Alam
  • 353
  • 1
  • 4
  • 16
9
votes
7 answers

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

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…
Calendula
  • 93
  • 1
  • 1
  • 8
9
votes
2 answers

laravel and swiftmail shows Process could not be started [The system cannot find the path specified]

I am writing an app that send mail to the client using laravel and swiftmailer but I get Process could not be started [The system cannot find the path specified.] error. Here is my code env settings MAIL_DRIVER = smtp MAIL_HOST =…
shabz4real
  • 451
  • 1
  • 5
  • 7
9
votes
7 answers

Sending email using php, gmail, and swiftmailer causes SSL-related error

Here is my PHP code: function SendCookieToTheMail() { require_once 'swift-mailer/lib/swift_required.php'; //Create the Transport $transport = Swift_SmtpTransport::newInstance('smtp.gmail.com') ->setPort(465) …
LostLord
  • 2,279
  • 10
  • 32
  • 32
9
votes
5 answers

How to send mail to multiple recipients in Yii2 mailer OR how to add setCc in yii2 mailer

How to send mail to multiple recipients in Yii2 mailer? This code for a multiple recipient but not working. $value = Yii::$app->mailer->compose() ->setFrom([$this->email => $this->name]) …
Kalai S
  • 986
  • 3
  • 14
  • 25
9
votes
3 answers

Unable to send e-mail from within custom Symfony2 command but can from elsewhere in app

I have written a custom console command to query my database, produce a report and e-mail it to an address; however I can not seem to successfully send the e-mail. I can send e-mail fine from within normal controllers elsewhere within my…
Kris
  • 1,094
  • 3
  • 13
  • 23
9
votes
4 answers

Changing smtp settings in SwiftMailer dynamically

I'm using SwiftMailer bundle with Symfony 2. I pass my smtp user/password settings in config.yml file, it works great, but I need to take this settings from database, when I'm sending mail. I can acces this params: $mailer =…
Ivan
  • 175
  • 2
  • 7
8
votes
1 answer

Can I use a traditional Email "To" line in SwiftMailer?

SwiftMailer expects an array of e-mail addresses, possibly including names as values of the array: $message->setTo([ 'person1@example.org', 'person2@example.net' => 'Person 2 Name', 'person3@example.org', 'person4@example.org', …
TRiG
  • 10,148
  • 7
  • 57
  • 107
8
votes
4 answers

SwiftMailer - PHP - How to disable ssl certificate validation

I need to disable the validation of ssl certificate for developing purpose but i don't find anything about this in official documentation. http://swiftmailer.org/docs/introduction.html I'm using php 5.6 and Symfony2 (v2.7). The configuration…
Angelo Giuffredi
  • 923
  • 3
  • 13
  • 26