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
Comment #1
kogor commentedThat'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?
Comment #2
franzkogor:
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.
Comment #3
kogor commentedfranz,
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?
Comment #4
franzMmm, 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.
Comment #5
wundo commentedClosing very old (dead) issues, if you think this is still relevant please re-open.
Comment #6
sirtetThe Issue still exists, and i just ran into it too.
(This is a great module, and i hope my feedback might help the next new user to get into it quicker.)
Only when i looked at the mail headers i realized what was happening.
I think a better help-text as in the issue summary would be an easy first fix, before more work is done.
(It should also state the fact that this will send a test-message upon saving this settings page.):
Instead of
I'd suggest
First i thought the behaviour should be to only send via SMTP Module, or do not send and show a message.
But in some scenarios it might be helpful to be able to send a test mail with the default mail system too, to compare things.
So i would maybe suggest to add a line to the test-mail itself,
"Sent via SMTP Module" | "Sent via default Mail System"
"See mail headers for more details"
Ideally, the test mail should be sent via SMTP already if the module is being activated in the same step.
PS:
This setting, "Turn this module on or off" is also confusing in itself, at first it seems to double the setting on the modules page, i created a separate issue about that: #2741675: Ambiguous option "Turn this module on or off"
Comment #7
sirtetJust noticed the Test-mail content:
This clearly indicates that the programmer wanted a mail that goes through SMTP in whatever case...
Comment #8
wundo commented@sirtet please update the target version for the one where you are experiencing it.