<![CDATA[ Support/Comments for modSwiftMailer (all versions) - MODX Community Forums]]> https://forums.modx.com/thread/?thread=39314 <![CDATA[Re: Support/Comments for modSwiftMailer (all versions)]]> https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=3#dis-post-524915 How to invoke Swift_SmtpTransport option in modswiftmailer to send mails via SMTP?

Hello everyone!

I use this manual (swiftmailer extra) to send form data from website to email:
http://rtfm.modx.com/extras/revo/modswiftmailer

$modx->getService('mail', 'mail.modSwiftMailer');
 
$modx->mail->address('to', 'recipient@domain.tld', 'Recipient');
$modx->mail->address('sender', 'sender@domain.tld');
$modx->mail->subject('A simple e-mail');
$modx->mail->body('<h1>Simple e-mail</h1><p>With a basic message</p>');
 
$modx->mail->send();


What is the way to use SMTP options?

Thank you!]]>
mixa_ru Apr 27, 2015, 08:11 AM https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=3#dis-post-524915
<![CDATA[Re: Support/Comments for modSwiftMailer (all versions)]]> https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=3#dis-post-500012
My call in my snippet looks like this:

    // mail confirmation
    $to = $email;
    $subject = 'My Subject';
    $modx->getService('mail', 'mail.modSwiftMailer');
    $modx->mail->address('to', $to, 'Recipient');

    $modx->mail->address('sender', $from);
    $modx->mail->address('from', $from, $fromName);
    $modx->mail->subject($subject);
    $modx->mail->body($message);
    $modx->mail->address('reply-to',$from,'Sender');
    $modx->mail->send();

]]>
harveyev Jun 11, 2014, 09:11 AM https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=3#dis-post-500012
<![CDATA[Re: Support/Comments for modSwiftMailer (all versions)]]> https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-486494
I thought this would be really easy to find, but I am having trouble finding stuff and understanding what is what.

I want to send an e-mail to all contestants for a contest after a manager clicks a button. My code cycles through all the contestants and checks if a time has been filed in. If this is the case, a personalized will be sent to the contestant. The e-mail template looks like this:
"Hi [name contestant],
[...]
You should be present at [starting time]

kind regards [..]"

This all works perfectly until there are more than 20 contestants. Since this is usually the case, this won't work.

If I understand correctly a plugin like Throttler should solve this, but I tested it using the code in this topic and couldn't get it to work.

The code I used:
$this->modx->mail->plugin('throttler', array(
	'active' => false,
	'rate' => 20,
	'mode' => 'messages' // toggle 'bytes' for Bytes ;) Do yehr own calculation
));


I didn't get the 'mode' part with the comment about calculating size in bytes (?). But I thought this wasn't really relevant because it's the amount of consecutive e-mails.

Am I completely wrong? I could also just send all contestants one generic e-mail saying their starting time has been updated with a link to the contest page, but that feels weak.

Thanks in advance smiley]]>
might-e Jan 04, 2014, 06:05 PM https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-486494
<![CDATA[Re: Support/Comments for modSwiftMailer (all versions)]]> https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-473210 how can i set the content type to text/plain?
I tried $swiftmail->body($body,'text/plain);
and $swiftmail->setPlain();
but neither seem to work
Rdg]]>
rdaneeel Jul 27, 2013, 11:55 AM https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-473210
<![CDATA[Re: Support/Comments for modSwiftMailer (all versions)]]> https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-434270 tnx

]]>
rdaneeel Aug 22, 2012, 08:39 AM https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-434270
<![CDATA[Re: Support/Comments for modSwiftMailer (all versions)]]> https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-434252 ReSpawN Aug 22, 2012, 07:29 AM https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-434252 <![CDATA[Re: Support/Comments for modSwiftMailer (all versions)]]> https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-434251
do i also need to add the returnPath here? Modx gives me an error on that
[2012-08-22 12:50:24] (ERROR @ /index.php) modSwiftMailer is missing a Return-Path


Rdg]]>
rdaneeel Aug 22, 2012, 07:24 AM https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-434251
<![CDATA[Re: Support/Comments for modSwiftMailer (all versions)]]> https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-434249
$modx->mail->address('from', 'from@domain.tld', 'Graphical sender');
]]>
ReSpawN Aug 22, 2012, 07:20 AM https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-434249
<![CDATA[Re: Support/Comments for modSwiftMailer (all versions)]]> https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-430105
$modx->mail->address('sender', 'info@voedingscentrum.nl');


is in there the mail says 'No Sender'. any ideas?
Rdg]]>
rdaneeel Jul 16, 2012, 06:53 AM https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-430105
<![CDATA[Re: Support/Comments for modSwiftMailer (all versions)]]> https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-426114
When I visit the Extras page it says don't use this version. Can anyone point me to the current version and let me know if this fix is in the mix.

Also, not documented how I add raw headers...what is the function call for that?

Big thanks and love the product.

G]]>
timbodrumbo Jun 08, 2012, 06:29 PM https://forums.modx.com/thread/39314/support-comments-for-modswiftmailer-all-versions?page=2#dis-post-426114