Download & Extend

Use smtp for test email even if module not "on"

Project:SMTP Authentication Support
Version:5.x-1.0
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

It appears that if the "Turn this module On or Off:" setting is set to "Off", that if you try to use the "Send a test email" feature it sends the email using the standard drupal mail facility, and not smtp. This is counter intuitive, as many users will attempt to send a test mail before turning on the module, believing that they are thus testing the module.

Also, it seems that even if you attempt to turn the module on AND send a test email at the same time, the test email is not sent using smtp. Currently it looks like you have to first turn the module on, and then go back and send a test email in order for it to be sent using smtp.

I think the best way to fix this would be to change the text for the test email field to say "Send test e-mail using smtp", and then change the code so that the test uses smtp even if the module is off.

If this is too much work, then my second choice would be to change the text below the test email field to say "Type in an address to have a test email sent there. You must first ensure that the SMTP module is already on before attempting to send the test email (see setting above), otherwise the test email will be sent using the standard Drupal mail service."

In any event, thanks for the great module! Solved my problem with certain emails not arriving, though at first I thought it didn't because of the issue described above.

Comments

#1

That's true, Drupal can send email without any modules.

But I have a reasonable question:

"What smtp-server does it use???"

I notice there is no settings in Drupal to put login and password for smtp authentication. How does it work then?

Does anybody know?

#2

Component:Code» User interface

kogor:

Drupal's default mail system uses PHP mail system, so whatever is configured on it will be used. This usually corresponds to the machine's mail sending mechanism. On unix-based systems, it uses the /usr/bin/sendmail command. Well, the machine's mail system might be configured in a whole number of ways, and may be wrongly set or such. On my machine, I even configured the system to use Gmail SMTP server. That's why this module exists, so you don't have to configure the server (to which you won't have access most of the time).

As to the issue, I changed to user interface.

By the way, I was thinking of just disabling the testing field when the module is off and displaying a message next to it explaining. That will be a quick fix. I'm a new maitainer, so I don't really know all the bits of code to say whether is possible to send a test e-mail WITH smtp settings while it's OFF.

#3

franz,

Is there any possibility to pass around the machine's mail system? My hosting provider closed the necessary ports for outgoing connections to external smtp-servers (such as smtp.gmail.com). They force me to pay them much money for this opportunity.

Can smtp module help me?

#4

Mmm, I've never tried anything like that. You would need to have a proxy to fool yor webserver. Or maybe a SSH tunnel, if you have SSH access to somewhere else (but it might be closed as well).

If you manage to use a proxy for a connection, I'm still not sure if phpmailer supports that.