swiftmailer

Got issue with Swift Mailer Not sending messages

我们两清 提交于 2020-01-02 08:38:33
问题 I have an issue with swift mailer, it is not sending message to the user I extracted the library to inc folder in my website and created the following message for swift mailer to send: NOTE: If you can suggest other solutions besides SwiftMailer, could you please leave a comment. require_once 'inc/lib/swift_required.php'; //Create the Transport $transport = Swift_SmtpTransport::newInstance('mail.mywebsite.com', 25) ->setUsername('info@mywebsite.com') ->setPassword('myPassword') ; $mailer =

Unable to send emails in Laravel using Swift Mailer - proc_open() function disabled by the provider

扶醉桌前 提交于 2019-12-31 03:25:06
问题 My web host disabled proc_open function in php and I can't send emails anymore. I get this error log: proc_open() has been disabled for security reasons I use laravel default Swiftmailer. What can I do? 回答1: proc_open should only be required when Swiftmailer is using an external executable, like sendmail. You should still be able to use a different transport like SMTP, Mailgun, or one of the other drivers described in the docs. As a test, try using the SMTP driver, and just entering your own

Swiftmailer not sending immediately

你。 提交于 2019-12-31 01:47:13
问题 I have successfully configure my symfony webapp to sending email using SMTP. But all my sending email are being put into the spool directory. This should only occurs whem there is an error in the sending. Is that correct? But if I execute the command swiftmailer:spool:send --env=prod , all my emails are sending correctly. Why my server are not sending the email immediately? Is that because I fixed an error? Is there any way to fix this? swiftmailer: spool: type: file path: %kernel.root_dir%

Swiftmailer mails go into SPAM Folder

时间秒杀一切 提交于 2019-12-30 03:27:09
问题 $headers = "\r\n" . "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $message = Swift_Message::newInstance() ->setSubject($subject) ->setFrom(array('from@mail.com' => 'From Address')) ->setTo(array('to@mail.com' => 'To Address')) ->setBody($message_plain_txt) ->addPart($message, 'text/html') ; if ($file_name) { $message->attach(Swift_Attachment::fromPath($file_path)); } $result = $mailer->send($message); In this case $filepath is the tmp path

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

丶灬走出姿态 提交于 2019-12-30 02:23:07
问题 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 application, and I can also send it from within my console command if I manually create and configure a Swift_Mailer instance and not get it via the container. Here is a stripped down version of my console command: <?php namespace Foo\ReportBundle\Command;

smtp relay - gmail - swiftmailer: Expected response code 220 but got code “”

心不动则不痛 提交于 2019-12-29 08:06:42
问题 I am using gmail as an smtp server for my swiftmailer class. however I am getting Expected response code 220 but got code "", with message "" in "\classes\Swift\Transport\AbstractSmtpTransport.php" What does this mean? 回答1: I think it probably means you sent a blank line to the smtp server. Make sure none of your commands have line feeds in them. Can you log the transaction and paste a copy of the log? see here for details about logging http://swiftmailer.org/docs/logger-plugin 回答2: I got

Send HTML mail with fallback to plain text mail via Swiftmailer

倾然丶 夕夏残阳落幕 提交于 2019-12-25 08:48:03
问题 How can you send HTML mail with a fallback to plain text mail with PHP Swiftmailer? 回答1: Create a message in Swiftmailer and use the setBody() function to set the text/plain version of your mail and use the addPart() function to set the text/html version of your email (with second parameter text/html ): $message = Swift_Message::newInstance() ->setSubject('Your subject') ->setFrom(array('john@doe.com' => 'John Doe')) ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) -

Swiftmailer using setReturnPath

大兔子大兔子 提交于 2019-12-25 06:56:11
问题 I am successully able to send emails via Amazon SES with the code below, but I am trying to set a return path and it doesnt work. When i use ->setReturnPath('bounce@example.com') the emails do not send at all. Can anyone shed some light why, or know how to get it to work? Any help would be great! This is the latest swiftmailer (4.2.2) require_once 'lib/swift_required.php'; require_once 'classes/Swift/Transport/AWSTransport.php'; require_once 'classes/Swift/AWSTransport.php'; require_once

Why am I receiving a 'failed to open stream' error when submitting data from a contact form?

早过忘川 提交于 2019-12-25 04:44:11
问题 I have created a HTML5 contact form that I'm currently testing on a local host (XAMPP) using Swiftmailer, and after clicking the submit button I get the following error: Warning: require_once(/swift.php): failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/testsite/sendmessage.php on line 10 Line 10 refers, obviously, to the require_once line in my PHP, however in my file it is encased in HTML tags. I believe that this error is telling me that the file

Change the location of the tmp directory for SwiftMailer in Symfony2

时光总嘲笑我的痴心妄想 提交于 2019-12-25 02:47:37
问题 My shared hosting does not allow me to use the root \tmp directory. I know that the location of the temp directory can be updated using the Swift_Preferences class, however, how do I do that for a SwiftMailer instance autoloaded by Symfony2? Is there a way to set it in my config.yml? I think the code should be: \Swift_Preferences::getInstance()->setTempDir($newTempDir); But how/where can I set this config? 回答1: There is more than a one way to do this. However, I think the best place for that