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 netcarver
      Part 1 of a 2 part Module & Service Reveal.
      I'm currently working on a new module: ModuleReleaseNotes that was inspired by the work I originally did on making Ryan's ProcessWireUpgrades module "release" aware. In the end, I decided to ditch the approach I was originally taking and instead work on a module that hooked in to the UpgradeConfirmation dialog and the module edit page.
      Aims
      My aims for this module are as follows...
      Make discovery of a module's changes prior to an upgrade a trivial task. Make breaking changes very obvious. Make reading of a module's support documentation post-install a trivial task. Make module authors start to think about how they can improve the change discovery process for their modules. Make sure the display of information from the module support files/commit messages doesn't introduce a vulnerability. Looking at these in turn...
      Making discovery of a module's changes prior to upgrade a trivial task.
      This is done by adding a "What's changed section" to the upgrade confirmation dialog.  This section takes a best-effort approach to showing what's changed between the installed version and the updated version that's available via the module repository.
      At present, it is only able to talk to github-hosted repositories in order to ask them for the release notes, the changelog file (if present) and a list of commits between the git tag that matches the installed version and the tag matching the latest version.
      It will display the Release Notes (if the author is using the feature), else it will display the commits between the tags (if tagging is used by the module author) else it will show the changelog file (if present) else it will show the latest N commits on the master branch (N, of course, being configurable to your liking.)
      An example of the Github Release Notes pulled in for you, taken from Mike Rockett's TextformatterTypographer Module...

      An example of a tag-to-tag commit list from the same module...

      An example of a changelog - formatted to show just the changes (formatting styles will change)...

      Finally, an example of a fallback list of commits - sorry Adrian ...

       
      Making breaking changes obvious.
      This is currently done by searching for a set of configurable search strings. Later versions may be able to support breaking change detection via use of Semantic Versioning - but this may require some way of signalling the use of this versioning standard on a module-by-module basis.
      For now, then, you can customise the default set of change markers. Here I have added my own alias to the list of breaking change markers and the changes section of the changelog is styled accordingly (these will be improved)...

       
      Make reading of a module's support documentation, post-install, a trivial task.
      This is done by making some of the support files (like the README, CHANGELOG and LICENSE files) readable from the module's information/settings screen. There is an option to control the initial open/closed state of this section...

      Here is Tracy's README file from within the module settings page... 

       
      Make module authors start to think about how they can improve the change discovery process for their modules.
      There are notes in each of the sections displayed on the upgrade confirmation page that help authors use each of the features...

       
      Make sure display of external information doesn't introduce a vulnerability.
      This is an ongoing concern, and is the thing that is most likely to delay or prevent this module's release lead to this module's withdrawl should a vulnerability be found. Currently, output is formatted either via Markdown + HTML Purifier (if it was originally a Markdown file) or via htmlspecialchars() if it has come from a plaintext file.
      If you discover a vulnerability, please get in contact with me via the forum PM system.
       
      Ongoing...
      For now, I've concentrated on integration with GitHub, as most people use that platform to host their code. I know a few people are hosting their repositories with BitBucket (PWFoo comes to mind) and some with GitLab (Mike Rockett?) and I would eventually like to have adaptor implementations for these providers (and perhaps GitKraken) - but for now, GitHub rules and the other hosts are unsupported.
       
      Links
      Github: ModuleReleaseNotes
      PW Module Repository: Here
    • By FrancisChung
      Hi,
      I was wondering if anyone knew what this did? 

      If so, do you know what modules it actually impacts? Is there another log that lists the action it took?

      I'm having some weird problems with PHP duplicate declaration per link below, since this module was run.
       
       
    • By tpr
      AdminOnSteroids
      Various admin tweaks to enhance ProcessWire admin.
      http://modules.processwire.com/modules/admin-on-steroids/
      https://github.com/rolandtoth/AdminOnSteroids

    • By Macrura
      Field Descriptions Extended
      This module enables you to extend field descriptions by dividing short descriptions with a longer text that is revealed in a toggle.
      Github: https://github.com/outflux3/FieldDescriptionsExtended
      Extending your field descriptions using the standard field's description field.
      Once this module is installed, it will automatically search your description field for the presence of 5 dashes (-----).
      Any content above the 5 dashes will be visible and the content below the dashes will be hidden. A 'More...' link will appear at the end of the short description which when clicked will reveal the rest of the description.
      Using Simple Markdown Editor with the description field
      If you have Simple Markdown Editor (InputfieldSimpleMDE) installed, you can enable the field description to have that editor.
      *When using Simple MDE, you can use the button (Insert Horizontal Line) instead of typing 5 dashes. More about SimpleMDE.
      Extending your field descriptions using content from a ProcessWire Page for the field description.
      You may use the content from a ProcessWire page as a field description. This would allow you to easily insert images, links, and use hanna codes.
      To use page content for your field descriptions, please follow these instructions:
      Install Select Fields module (FieldtypeFields) http://modules.processwire.com/modules/fieldtype-fields/ Create a new field using this field type, e.g. field_select. Add the field to any template you will be using for your field descriptions. Setup your help pages (for example under a settings branch) where you will store the field description content,using the template containing the Field Select. Add content to a page and select the field where that content should show. To show a short text before the link to the longer content, separate them with 5 dashes Be sure to update your settings on this page, first enable page content descriptions,then specify the name of the Select Fields field, template to search, and content field. If you create a field description using this method, please note that the description field must be blank for contexts where you want the page content to appear.
      You can freely use template context for field descriptions, but the Page Content method is not context sensitive and will display under all contexts where the description is blank.
      ----
      original post:
      This is a new module, hope to release soon, which allows extended field descriptions, in currently 2 ways.
      The main feature of the module is that you can have a short description and then a 'more...' link which drops down a longer block of text.
      This is achieved by separating the intro/visible text and the rest with 5 dashes.

      Example setup:

      the 2nd way is if you are using AdminThemeUiKit, you can show extended field instructions in a panel. The content of the panel is edited on a regular PW page. This use case would probably not be that common, but if you had a field that required some extended instructions for how to use, this could be useful; Also, since this allows you to target information and instructions down at the field level, it could reduce the amount of documentation needed on a global level, since it is a lot more context targeted.