Jump to content

WireMailSmtp


horst

Recommended Posts

  • 4 weeks later...

Is it possible to temporarily overwrite the smtp host and smtp user defined in settings with the API? I would like to send some emails using a different smtp server with different credentials from the one I entered in the module settings.

Link to comment
Share on other sites

@Marc I think you can do the same with hosts.

On 19.04.2017 at 11:53 PM, horst said:

In the modules config screen you can set it under "sender_reply". Also a "sender_errors_to" is available.

58f7ce523b5fd_fireshot_screen_capture_133.png.65d465c1517632f261929bd7d23e2715.png

If you need to set it dynamically, you must go the workaround with modifying module config-settings via API. If so, you will find examples here in this thread or the forums in general.

 

you can use this:


$data = wire('modules')->getModuleConfigData("WireMailSmtp");

// or, regarding on scope,
$data = $modules->getModuleConfigData("WireMailSmtp");

than modify the reply adress:


$data["sender_reply"] = "you@example.com";

after modifying, you can write it back:


wire('modules')->saveModuleConfigData("WireMailSmtp", $data);

// or

$modules->saveModuleConfigData("WireMailSmtp", $data);
 
 
  • Like 2
Link to comment
Share on other sites

Hello,

I have a big problem that I totally don't understand and it's becoming really really problematic because it's on a online shop.

The module was working before, with some "cannot connect to smtp-server!" but not so much.

But since some weeks, there is "Error in hnsmtp::send : it were not specified any valid recipients" a lot, like really a lot.

I use it like this : $mail->sendSingle(true)->to($dest)->bcc($dest_admin);

$dest and $dest_admin are email.
The emails are corrects.  

I tried multiples times but without changing anything and with the same emails, I can have 1 time the error et 9 time everything works fine...

I would really like some help :( 

Link to comment
Share on other sites

1 minute ago, Sonia Margollé said:

Hello,

I have a big problem that I totally don't understand and it's becoming really really problematic because it's on a online shop.

The module was working before, with some "cannot connect to smtp-server!" but not so much.

But since some weeks, there is "Error in hnsmtp::send : it were not specified any valid recipients" a lot, like really a lot.

I use it like this : $mail->sendSingle(true)->to($dest)->bcc($dest_admin);

$dest and $dest_admin are email.
The emails are corrects.  

I tried multiples times but without changing anything and with the same emails, I can have 1 time the error et 9 time everything works fine...

I would really like some help :( 

Often times when things like this happen it's because you've gone over your limit for emails to send through a particular SMTP host. Who are you trying to send through?

Link to comment
Share on other sites

1 minute ago, ethanbeyer said:

Often times when things like this happen it's because you've gone over your limit for emails to send through a particular SMTP host. Who are you trying to send through?

I use OVH 

The site is on for more than a year now,  I had a lot of "Error in hnsmtp::send : cannot connect to smtp-server!"  
even if I never change module configuration and if I check it's ok. And now the recipients ...

All the emails that I send using the module it's only to 1 recipients and sometimes another on in copy. 

smtp_config.jpg

Link to comment
Share on other sites

2 hours ago, Sonia Margollé said:

I use OVH 

The site is on for more than a year now,  I had a lot of "Error in hnsmtp::send : cannot connect to smtp-server!"  
even if I never change module configuration and if I check it's ok. And now the recipients ...

All the emails that I send using the module it's only to 1 recipients and sometimes another on in copy.

Check this out:

http://docs.mailpoet.com/article/49-lists-of-hosts-and-their-sending-limits

 

For OVH:

591f10824f724_ScreenShot2017-05-19at11_33_18.thumb.png.b068c9e4bb22c4e28fe4178a05a8dd6e.png

 

Most likely because of bounces, your site is unable to send emails.

A couple of things you can do:

1. Contact OVH and ask them to give you some idea of what your email's standing is.

2. Use a service like Sendgrid (sendgrid.com) as an off-site SMTP delivery service. If I remember correctly, Sendgrid is free up to 12,000 emails a day.

 

Hope this helps!

  • Like 1
Link to comment
Share on other sites

Thanks, I will check that !

I try to put some log in the module and I was able to have a more detailed error message, I think

"554 5.7.1 <---->: Recipient address rejected: You have exceeded the limit of 400 messages per hour and per IP address. Please, re-try later."

What I don't understand is how that can be, never 400 messages are send via the website, and not 20 per hour to.  Oo
If I wait like 30 seconds, it's ok again.  And the emails are good, the clients can send emails directly without problems. 

Knowing it's a shared hosting, is it possible that other peoples on the server are blocking everyone ? 

  • Like 1
Link to comment
Share on other sites

3 minutes ago, Sonia Margollé said:

"554 5.7.1 <---->: Recipient address rejected: You have exceeded the limit of 400 messages per hour and per IP address. Please, re-try later."

Knowing it's a shared hosting, is it possible that other peoples on the server are blocking everyone ? 

If it's shared hosting and all of the sites on your IP are potentially sending emails, that is almost certainly your problem.

Again, I'd look into an email delivery service like Sendgrid, Mandrill or even TurboSMTP - these will help with deliverability, and you won't be competing with other sites on the same IP to get emails out.

  • Like 2
Link to comment
Share on other sites

I'm not knocking sendgrid, or any other email service. After working in the adult industry (I know, don't judge me. I was young and needed the money :) ), I am not too fond of services that want a 'contacts list' stored at their site. You may want to consider gmail, or the like, for sending small quantities of emails. If you need an email company domain, eg, yourname@yourdomain.com, then they will provide that for a small monthly fee, usually $5 or so. I have never exceeded gmail's limit, and it is far better than trying to run your own email server.

Also, the majority of my applications require subscribers to use their company email address. I have the company create a site admin email address on behalf of the application, which eliminates the need for any third-party solutions.

If you need the capacity of those email services, then by all means use them. They handle that particular need well. Just be cautious of how they treat your contacts, if they require it.

Another possibility is to move to a VPS hosting account that has an email feature. That way you are the only user that they audit to affect any email limitations.

 

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

I have a little problem:

I installed the plugin, set up my form submit PHP file and when I do a connection check - everything is ok! There is no error at all.

When sending the mail it is logged and everything seems fine. Except one thing: The message is never delivered!

Of course I tried to look into the spam folder - but no. The email just seems to disappear when hitting the submit button.

To make sure that my server is running correctly i tried the native mail() PHP method with the form - that is working!

 

So what might be the error in this case? Any ideas?

 

Link to comment
Share on other sites

15 hours ago, cstevensjr said:

Make sure you are at least testing sending from one mail provider to another.

Here are two links that may help you:

http://kb.mailchimp.com/delivery/spam-filters/im-not-receiving-my-test-campaigns

https://productforums.google.com/forum/#!topic/gmail/HB31aN_GR_8

 

Sending e-mails from one acccount to another works fine. I just can't get wiremail to do it. I even tried it with different mail accounts.

Link to comment
Share on other sites

If possible, What domain where you sending from and to what domain where you sending to in your test emails?  Are these accounts/SMTP Service associated with Your Hosting Provider, Gmail, Microsoft or any other third-party email provider?

  • Like 2
Link to comment
Share on other sites

2 hours ago, cstevensjr said:

If possible, What domain where you sending from and to what domain where you sending to in your test emails?  Are these accounts/SMTP Service associated with Your Hosting Provider, Gmail, Microsoft or any other third-party email provider?

I tried both. Sending from mail accounts of my hosting provider to the same accounts. Or third party mail providers. Nothing gets delivered. I think I'll ask the support of my hosting provider.

Link to comment
Share on other sites

You should try to uninstall WireMailSMTP and try sending with native WireMail. This should work, as it uses the PHP mail() function.

If WireMail works, and WireMailSMTP don't, it might be firewall restricted by your hosters settings. Native PHP mail function is controlled and allowed by your hoster, other (foreign) connections (other IPs or only Ports) maybe blocked by firewall settings of your hoster. (?)

  • Like 3
Link to comment
Share on other sites

23 hours ago, horst said:

You should try to uninstall WireMailSMTP and try sending with native WireMail. This should work, as it uses the PHP mail() function.

If WireMail works, and WireMailSMTP don't, it might be firewall restricted by your hosters settings. Native PHP mail function is controlled and allowed by your hoster, other (foreign) connections (other IPs or only Ports) maybe blocked by firewall settings of your hoster. (?)

That's good point to start with!

I have already contacted my provider becaouse I think there could be a firewall issue, too. Otherwise I have no explanation for this.

However, I will definetly test out the native WireMail variant.

Link to comment
Share on other sites

Problem solved.

My bad. In my source code I had commented out the following line:

$numSent = $mail->send();

That was the case because a little time ago when I was developing the submit form, I must have tried to test something. 

What made me so confused was the fact that the activity log still said "mail send" so I never looked into this part of the code again.

Now that's a really stupid thing, sorry that I bothered you with it. 

 

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

I've installed WireMailSmtp on my locally hosted ProcessWire site v 3.0.62 and filled in my sendgrid data and get a WireMailSmtpConfig: SUCCESS! upon testing

When I try the following:

if($mail->className != 'WireMailSmtp') {
    echo "<p>Couldn't get the right WireMail-Module (WireMailSmtp). found: {$mail->className}</p>";
}

I get "Couldn't get the right WireMail-Module (WireMailSmtp). found: WireMail"

How do I get the wiremail function to make use of the WireMailSMTP addon?

Link to comment
Share on other sites

  • 4 weeks later...

In PW 3.0.42 when editing a user this error appears up top:

Quote

Strict Standards: Declaration of WireMailSmtp::attachment() should be compatible with ProcessWire\WireMail::attachment($value, $filename = '') in /Applications/AMPPS/www/catco/site/assets/cache/FileCompiler/site/modules/WireMailSmtp-master/WireMailSmtp.module on line 22

 

Link to comment
Share on other sites

  • 2 weeks later...
On 3.9.2017 at 2:46 AM, hellomoto said:

In PW 3.0.42 when editing a user this error appears up top:

 

@hellomoto I couldn't reproduce this. Which version of WireMailSmtp you're using? I am on the same PW version but I am currently struggeling with the HTML signature. 

 

Using this code, triplechecked that at HTML signature is stored in the WireMailSmtp settings, but - and thats the fun fact - it does not work within a HTML mail - but the signature is added to the plaintext. 

		$mail = wireMail();
		$mail->from($email, $name);
		$mail->to("me@me.com", "Me");
		$mail->subject('new message - '.$config->httpHost);
		//$mail->addSignature(true); ==> has no effect either since I chose "send signature with _every_ message" in the module settings
		$mail->bodyHTML($message);
		$mail->send();

 

Has this happened to anyone before? And if so: how did you solve this?

Link to comment
Share on other sites

@horst it doesn't have any tags (except the tags I am adding to the message manually).

I tried a downgrade to 0.2.3 => no success - same problems

I just installed version 0.2.5 => still no tags but the signature is there... 

this is what the mail content looks like (headers are removed)

--3e089748ac63f63eedf33dc907a71870
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

hallo

--
PLAIN blablabla
--3e089748ac63f63eedf33dc907a71870
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<strong>hallo</strong>

HTML <br><br><strong>blablabla</strong>
--3e089748ac63f63eedf33dc907a71870--

so it seems as if my problem has been solved - but it's still somehow weird that there are not tags... If you want me to share more details and/or sources please let me know. Would be glad if I can help you :) 

Thanks for providing this module & the support!

 

 

Link to comment
Share on other sites

  • SebastianP changed the title to Strange PHP error in WireMailSmtp: unexpected fully qualified name "\getmessage"

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
×
×
  • Create New...