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
22
votes
3 answers

Symfony 3.3 and Swiftmailer - mail created and sent by controller deferred by server

I'm trying to use Swiftmailer to send emails out from a website. The emails keep getting deferred because Swiftmailer is attempting to use my server's IP address rather than localhost as the relay: Aug 2 14:18:28 picus sm-mta[21171]:…
Major Productions
  • 5,914
  • 13
  • 70
  • 149
22
votes
8 answers

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

I'm posting because I've already gone through the solutions posted in other questions on here but they haven't helped. What I am trying to do is send email using Swiftmailer through Google Apps for Business Gmail but I keep getting this…
Jonathan
  • 3,016
  • 9
  • 43
  • 74
22
votes
3 answers

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

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…
gremo
  • 47,186
  • 75
  • 257
  • 421
20
votes
3 answers

How do I send an email with Laravel 4 without using a view?

I'm developing a site using Laravel 4 and would like to send myself ad-hoc emails during testing, but it seems like the only way to send emails is to go through a view. Is it possible to do something like this? Mail::queue('This is the body of my…
Jason Thuli
  • 736
  • 2
  • 8
  • 23
20
votes
7 answers

Symfony2 Swiftmailer Not Sending

I am having trouble sending emails with symfony2 and swiftmailer. I am also a bit lost on how to debug this issue. Below is the code. First I am creating a form to display. On submit (request->method == post) I then try to send the email. I am…
Shawn Northrop
  • 5,826
  • 6
  • 42
  • 80
19
votes
4 answers

PHP - Swiftmailer using STARTTLS and self signed certificates

I'm trying to send an email with php and swiftmailer, using STARTTLS, but I'm getting a certificate error. I have root access to the SMTP server, and the certificate used is self-signed. I'm using Debian on both machines (web server and smtp…
David Ventura
  • 418
  • 2
  • 7
  • 20
17
votes
1 answer

Sending an HTML email using Swift

I would like to send an auto-generated email with HTML body from my application using Swift. Here is my current code: $message = Swift_Message::newInstance() ->setFrom(array('dummy1@test.com' => 'John Doe')) …
Rui Gonçalves
  • 2,423
  • 6
  • 30
  • 42
17
votes
5 answers

Logging swiftmailer send() activity in symfony2

Im using swiftmailer for sending mails from my symfony2.2 project. Is there a way to log globally all email info and send results? It would be great if mailer send() method have trigger somę event, but I can't see it does.
tiriana
  • 668
  • 1
  • 7
  • 24
17
votes
2 answers

PHP Library to read email

I currently use the SwiftMailer library to send email, but unfortunately it's only for sending, not receiving. I'm wondering... is there a similar library to connect via IMAP to an email account and read the email (IE give me the ability to loop…
TheFrack
  • 2,823
  • 7
  • 28
  • 47
16
votes
6 answers

Tracking email bounces, opens, clicks

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…
GeekJock
  • 11,066
  • 13
  • 43
  • 44
16
votes
4 answers

Object of class Illuminate\Mail\Message could not be converted to string

I am using Laravel 5.5 trying to send email but getting error Object of class Illuminate\Mail\Message could not be converted to string here is my controller public function contactreply($contact, Request $request){ $reply = new Reply; …
sid heart
  • 561
  • 1
  • 4
  • 9
16
votes
3 answers

How the laravel Mail::failures() function works?

I've been trying to get the list of recipients who did not get email using laravel Mail::send() function. I am trying following code. for loop is used as because each user to be received customized message. // First recipient is actual, the second…
Rajan Rawal
  • 6,171
  • 6
  • 40
  • 62
16
votes
5 answers

Bypass Gmail's spam filter (mails sent with PHP from a shared host)

TL;DR: Mails sent from shared hosting (such as a cheap domain from Unoeuro or One.com) end up in spam. How to fix? I made a mail-system, that first generated a PDF-file (using FPDF), whereafter it sent the PDF-file as an attachment with PHP's…
Zeth
  • 2,273
  • 4
  • 43
  • 91
16
votes
4 answers

How to close Smtp connection in SwiftMailer

I use SwiftMailer to send emails from a gearman worker process. I'm using the Swift_SmtpTransport class to send emails. The problem is that if this worker process stays idle for sometime, the SwiftMailer smtp connection times out. Now when the next…
Nands
  • 1,541
  • 2
  • 20
  • 33
16
votes
3 answers

swiftmailer and email form with attachment - beginner

As always here is the place where I have learned a lot. And I have now a new things to learn: I have a html form: File attachment: and a…
TryHarder
  • 750
  • 1
  • 9
  • 22