horst

WireMailSmtp

Recommended Posts

Oh, google only blocks Thunderbird, Outlook, 60% iOS apps and some more. Yes, of course, the only reason is security for users. ūüôĄ

@gebeer you may recherche on phpclasses.com, if the smtp class of Manuel Lemos has enhancement for this already. Im totaly behind my time schedules atm. Sorry. 

  • Like 1

Share this post


Link to post
Share on other sites
14 hours ago, gebeer said:

I am experiencing problems when sending through Gmail on a site that is sending out quite a lot of emails to different recipients.

For high mail volumes something like Mailgun is probably better. I've only used WireMail Mailgun in one project so far but it worked great.

  • Like 4

Share this post


Link to post
Share on other sites

I can also vouch for Mailgun. Its great, never had problem for the last 3 years I've been using it. Free tier is very generous too.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you for your suggestions. It is not that many mails, maybe a total of 100 a day and max 10-30 per hour. So I will stay with Gmail for the time being.

Share this post


Link to post
Share on other sites
Just now, gebeer said:

Thank you for your suggestions. It is not that many mails, maybe a total of 100 a day and max 10-30 per hour. So I will stay with Gmail for the time being.

That's still a lot for Gmail.  Simply knowing about Gmail's Bulk Sending Guidelines should help you since you want to keep using them.

  • Like 3

Share this post


Link to post
Share on other sites

@horst Can you tell me how/where in the module this hijacks/extends wireMail()? I'm glad that it does, but I am desperate to understand how this works.

new WireMail();  // WireMail
new wireMail();  // WireMail
wireMail();      // WireMailSmtp
$mail->new();    // WireMailSmtp

This has highlighted one of the many parts of my PW knowledge that is majorly lacking.

 

 

Edit:
Ok. Finally get it. Here's how it works, for anybody else that wonders...

wire/core/boot.php loads JUST WireMailTools. WireMailTools::new() looks for any classes that overlay on WireMail. If WireMailSmtp is installed, it will be the class that is returned.

If none are found, it defaults to WireMail.

Shooooo-wee. Nice to know!

  • Like 1

Share this post


Link to post
Share on other sites

Is anyone using this module in combination with SendGrid? I had the module working til a few weeks ago and now I get a time out error that I can't connect to mail.sendgrid.net. Not sure what the exact settings need to be as Sendgrid isn't too clear on this as far as I can find.

Share this post


Link to post
Share on other sites

I've no experience with Sendgrid but just in case helpful, I used to use Mandril until they changed their pricing model from reasonable to insane (for small users), at that time I went with Postmark https://postmarkapp.com/ and have had a faultless experience with them for over year over multiple sites (I'm not on a commission ;))

  • Like 1

Share this post


Link to post
Share on other sites
12 minutes ago, alan said:

I've no experience with Sendgrid but just in case helpful, I used to use Mandril until they changed their pricing model from reasonable to insane (for small users), at that time I went with Postmark https://postmarkapp.com/ and have had a faultless experience with them for over year over multiple sites (I'm not on a commission ;))

Snap here on the PostMarkApp part. It may have been you who pointed me to them. :)

Do you verify all your individual domains via SPF and DKIM verified authentication?

P

Share this post


Link to post
Share on other sites

:) I am sure I have 'bigged' them up before here yes (it was so lovely meeting them after the bottom fell out of Mandrill when then went for DaftPricing‚ĄĘÔłŹ.

I would like to have individual SPF and DKIM records for each client. A few have asked about why emails though apparently from "noreply at Example Inc." are clearly actually from me@mycorps domain if they reply to one. I've told them all that to save them money the emails come from my DKIM'd and SPF'd email address, but I can do the same for them if they pay for my time setting it up. So far all have said "Oh.., that's why eh? Never mind, leave it as is".

One day I will go tell each of them they must get their records setup, but it's just one of those things that's on the ToDo that's not shouting to be done 'today' ;)

Share this post


Link to post
Share on other sites
5 minutes ago, alan said:

:) I am sure I have 'bigged' them up before here yes (it was so lovely meeting them after the bottom fell out of Mandrill when then went for DaftPricing‚ĄĘÔłŹ.

I would like to have individual SPF and DKIM records for each client. A few have asked about why emails though apparently from "noreply at Example Inc." are clearly actually from me@mycorps domain if they reply to one. I've told them all that to save them money the emails come from my DKIM'd and SPF'd email address, but I can do the same for them if they pay for my time setting it up. So far all have said "Oh.., that's why eh? Never mind, leave it as is".

One day I will go tell each of them they must get their records setup, but it's just one of those things that's on the ToDo that's not shouting to be done 'today' ;)

Good approach. Same here on the authentication etc.

I just verified a single domain - one of my own and send in all responses to clients as "webforms@edenstudios.com". They're pretty ok with that as they recognise them immediately.

 

Share this post


Link to post
Share on other sites

@horst, I'm not sure how you'd feed about this but do you mind if I fix labels, icons a bit and send PR for it?

I mean turning this:

image.png.925884525248ef16fe42206d20d37454.png

Into something like this:

image.png.8482c1877b163607241ad8c51ef2dd99.png

  • Like 1

Share this post


Link to post
Share on other sites

That's made me think - I could¬†set up a generic domain, like¬†Campaign Monitor use¬†createsend.com, and send all emails from that. May do that if I need the emails to be more anonymous for any reason ūüĎć

  • Like 1

Share this post


Link to post
Share on other sites
16 hours ago, abdus said:

@horst, I'm not sure how you'd feed about this but do you mind if I fix labels, icons a bit and send PR for it?

I mean turning this:

image.png.925884525248ef16fe42206d20d37454.png

Into something like this:

image.png.8482c1877b163607241ad8c51ef2dd99.png

Apreciated! Send me the PR. ūüėÄ

Share this post


Link to post
Share on other sites

Just realized that I forgot to increment the version, I appreciate if you could sort that out

  • Like 1

Share this post


Link to post
Share on other sites

Hi,

I'm having an issue with the 'Test Settings' feature.

Some background: I have a contact form which sends an email (triggered by ajax), which seems to work a couple of times, but then starts throwing 500 errors on send.

At the same time, once the contact forms starts throwing 500 errors, clicking 'Test settings' in the module settings panel throws the same error:

image.png.b7976c2b25a5628657f69c976aa6fd66.png 

I'm not sure where to start finding the source of this issue - it seems that sometimes clearing compiled files solves the issue temporarily, but beyond this I'm not sure what to do.

We're running the latest Dev branch, but swapping to Master didn't prevent the issue.

Any advice on how to resolve this would be much appreciated!

Thanks,

Tom

Share this post


Link to post
Share on other sites

It sounds like an issue with FileCompiler; it's adding/failing to add namespace prefixes to where it shouldn't.

But, I don't see anything on line #678 that could be prefixed. What do you have there in compiled (site/assets/cache/FileCompiler/site/modules/WireMailSmtp) and noncompiled (site/modules/WireMailSmtp) versions?

image.thumb.png.cc8692e1166b325634291cd07d46a372.png

Share this post


Link to post
Share on other sites

Thanks for the swift reply!

Prior to trying to send a form, I see:

Function SendMail($to, $subject, $body, $headers, $return_path)

Then once I have tried to send a form, I see this:

Function \ProcessWire\sendmail($to, $subject, $body, $headers, $return_path)

The partial which handles the ajax request is like this:

<?php
namespace ProcessWire;

use Valitron\Validator;

function getInput($modules, $sanitizer, $input, $user) {
...
$v = new Validator([ ... ])
...
$formFields = [...]
return $formFields; // This contains the sanitized form fields content and the validation results
}

function sendMail($formFields, $modules, $pages, $sanitizer) {
...
if ($v->validate()) {
...
$mail = wireMail()
	->to($contactFormRecipient)
	->header('Reply-To', $email)
	->subject(ucwords($mailer_subject))
	->bodyHTML($messageHTML);
...
}
}
}

$formFields = getInput($modules, $sanitizer, $input, $user);
$output = sendMail($formFields, $modules, $pages, $sanitizer);
if ($output['sent']) {
	echo json_encode(array(...));
} else {
	echo json_encode(array(...));
}

Does the namespaced compiled function look right to you?

Share this post


Link to post
Share on other sites

Great, thank you for confirming.

Is there anything I can do in the meantime to get around this? 

 

I'm on the 3.0.79 dev branch

Share this post


Link to post
Share on other sites

Hmm, on second look, I don't have your issue, it works fine in my setup. Compiled file doesn't have the namespace prefix.

image.thumb.png.60b9a0a45c76415e9a3e3cd00173a8f8.png

You problem might be caused by something else.

Share this post


Link to post
Share on other sites

Could it be to do with the fact I've named the function in my template sendMail? It only just occurred to me that it's the same as the function used by wireMail.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By kixe
      Email Verification
      This module provides functions to validate email adresses and hosts. The module generates a textfile for blacklisted mailhosts (trashmail), which will be always up to date.
      Download
      https://modules.processwire.com/modules/email-verification/
      API
      // get module $mailcheck = $modules->get('EmailVerification'); // return bool/ string - automatted update of blacklist file $mailcheck->blacklisted(email|domain) // return bool - validate a top level domain, checks against IANA list $mailcheck->validTLD(tld) // return array of punycoded TLDs - cyclic updated, data pulled from IANA $mailcheck->getTLDs(cycle=2592000) // return bool - checks syntax converts to punycode $mailcheck->validDomainName(domain); // return bool - checks punycode encoded syntax $mailcheck->validHostName(host); // return bool - checks syntax and accessibility $mailcheck->validHost(email|domain) // add a single value to blacklist $mailcheck->addToBlacklist(email|domain) USAGE
      $mailcheck = $modules->get('EmailCheck'); $email = 'susi@trashmail.com'; if($mailcheck->blacklisted($email)) echo 'Email Provider not allowed'; if(!$mailcheck->validHost($email)) echo 'Mailhost not available'; Example blacklist file:  blacklist.txt
       
    • By teppo
      Code Blocks Textformatter is a tiny Textformatter module I cooked up to add support for code blocks to text/textarea/RTE fields on some of the sites I work with. Unlike a full-blown Markdown Textformatter ‚Äď which is something that we already have in the core ‚Äď this module simply adds support for fenced and inline code blocks.
      The syntax is based on the GitHub code block documentation, so please refer to that for additional instructions. The README at GitHub also includes some basic examples. As with any Textformatter, in order to enable this one, install it and enable it via field settings. Note that there's no syntax highlighting built in (at least for the time being), so use a tool of your choice for that ‚Äď personally I prefer Prism.js.
      Since this module doesn't use a Markdown tool behind the scenes, but rather some home baked regular expressions, there's always the possibility that I've missed something ‚Äď but please let me know if you use this module and run into any issues. On the other hand this module should be relatively fast and unobtrusive, as there are no unnecessary bits of code to run¬†
      GitHub repository: https://github.com/teppokoivula/TextformatterCodeBlocks Modules directory: http://modules.processwire.com/modules/textformatter-code-blocks/
    • By theo
      Here is my first processwire module (beta).
      https://github.com/theo222/ImagePickerField
      A lot of "first times". First time Github, Markdown and of course PW Modules.
      So be gentle please.
      I hope it works.

    • By horst
      Image Animated GIF  v 2.0.2
       
      Module for PW 2.5 stable or newer, but is obsolete for PW Versions greater then 3.0.89 (... read more ...)
       
      This module helps with resizing and cropping of animated GIFs when using the GD-Library.
      The GD-Library does not support this.


      This module is completely based upon the fantastic work of

         László Zsidi (http://www.gifs.hu/, builts the initial classes)
         xurei (https://github.com/xurei/GIFDecoder_optimized, enhanced the classes)


      I have ported it to a PW module and it works with core imagefields, together with Pia and with CropImagefields that uses the new naming scheme since PW 2.5.
       
      ------------------------------------------------------------------------------------------------------------------------------------------
      read more in this post about the rewrite from version 1.0.0 to version 2.0.0
      ------------------------------------------------------------------------------------------------------------------------------------------
      You can find it in the modules directory: https://modules.processwire.com/modules/image-animated-gif/
      and on Github: https://github.com/horst-n/ImageAnimatedGif
      ------
      A preview can be found here