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
15
votes
2 answers

swift mailer error 'Swift_RfcComplianceException' on an email that actually works?

My swift mailer plugin has just thrown up an error because an email address it tried to send to isn't compliant. Problem is - the email is valid. Basically, I don't want swift mailer to be checking whether or not the email is valid I'd like it send…
willdanceforfun
  • 11,044
  • 31
  • 82
  • 122
14
votes
2 answers

Attempted to call an undefined method named "newInstance" of class "Swift_Message"

Since a few days I can't send email anymore using Symfony and Swiftmailer, though I'm using the code from the documentation private function _sendResetPasswordEmail(UserInterface $user) { $subject =…
allan.simon
  • 3,886
  • 6
  • 35
  • 60
14
votes
1 answer

Is there a proper way to add NTLM auth type into SwiftMailer using SwiftMailer bundle in symfony?

I have symfony project with swiftMailer bundle. I was trying to send email via swiftmailer using NTLM auth. But I have not found a way to turn on NTLM via configuration of the bundle. After struggling with it I have found solution First…
sectus
  • 15,605
  • 5
  • 55
  • 97
14
votes
3 answers

SwiftMailer error Undefined property: Swift_Transport_StreamBuffer::$_sequence

I'm using SwiftMailer to send email by SMTP. The library is working fine when running in the server with PHP version 5.4. However, after upgrading the server to PHP version 5.5, email was not sent and the server threw the following error: Undefined…
Osh Mansor
  • 1,232
  • 2
  • 20
  • 42
13
votes
1 answer

Multiple Attachments with Swiftmailer

I'm creating a form that allows multiple files to be uploaded. The form field values and attachments are then to be emailed to certain address. I'm using Swiftmailer to generate these emails. I know how to attach a file with Swiftmailer, but I…
jake
  • 1,929
  • 3
  • 23
  • 31
13
votes
3 answers

Laravel 4 mail class, how to know if the email was sent?

I'm using the new mail class in Laravel 4, does anybody know how to check if the email was sent? At least that the mail was successfully handed over to the MTA...
ebelendez
  • 848
  • 2
  • 12
  • 22
13
votes
5 answers

add inline image to a message sent with swiftmailer

Please excuse my php but, Im using Swiftmailer to send emails from a clients website. They've requested to add an image or two as a signature etc and so looking at the swiftmailer spec here http://swiftmailer.org/docs/messages.html They suggest…
somdow
  • 6,268
  • 10
  • 40
  • 58
12
votes
1 answer

Disable swiftmailer spool in Symfony per environment

I having trouble send bulk emails with symfony2 via console command. I want to disable the mail spooling complete for the env the console is running in but keep it working for the default env. So I have this in config.yml: swiftmailer: …
David Stone
  • 588
  • 1
  • 5
  • 16
12
votes
2 answers

Inject SwiftMailer into symfony2 service

I have a service which extends UserManager, so when I do: $message = \Swift_Message::newInstance() ->setSubject('~') ->setFrom('~') ->setTo('~') ->setBody('~', 'text/html'); …
Andrew Atkinson
  • 4,103
  • 5
  • 44
  • 48
11
votes
1 answer

Sending email with Swift Mailer, GMail and PHP, Permission Denied Error

I downloaded SwiftMailer 4.1.6 for sending email using Gmail. I had written the following code for that purpose.
Jomoos
  • 12,823
  • 10
  • 55
  • 92
11
votes
3 answers

Should I use PHPMailer or SwiftMailer?

Possible Duplicate: PhpMailer vs. Swiftmailer? I have always used PHP's built in mail() function and it has always worked for me without fail and does the job I want it to. Now some maybe thinking 'Why fix something that isn't broke ?'. My answer…
PHPLOVER
  • 7,047
  • 18
  • 37
  • 54
11
votes
3 answers

Swiftmailer - Uncaught Error: Call to undefined method Swift_SmtpTransport::newInstance()

I'm trying to send email using the Swiftmailer. I'm getting an Uncaught Error: Call to undefined method Swift_SmtpTransport::newInstance(). Here is the code: require_once 'swift/lib/swift_required.php'; $transport =…
K Davis
  • 121
  • 1
  • 1
  • 5
11
votes
8 answers

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

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…
tim peterson
  • 23,653
  • 59
  • 177
  • 299
11
votes
3 answers

How do I get HTML email content before sending in Yii2?

I want to replace all links in the HTML email with tracker. As far as I know there is this EVENT_BEFORE_SEND event. So I created some behavior that can be used like below $mailer = \Yii::$app->mailer; /* @var $mailer \yii\mail\BaseMailer…
Petra Barus
  • 3,815
  • 8
  • 48
  • 87
11
votes
3 answers

Swift Mailer - Can't send mail, and can't find error logs

New to PHP and Swiftmailer and have yet to get it working. I've uploaded the /lib/ directory to a directory in the root of my shared webserver from Hostgator. I've uploaded the following inside in the directory above /lib/:
d.h276
  • 137
  • 1
  • 2
  • 8