It turned out that DNS resolution behaves different whether the mail function is called in Apache server / module process context, or when ran from the test command line program. Replacing the SMTP DNS name with its IP4 address did the magic. But I'd rather use the symbolic name... >> smtp failed with Failed to authenticate with the given credentials, > > So, that clearly tells us it's the authentication part that's not working. Yes, that what the error message is saying. My question has been on the root cause of this because authentication (and sending mail) is working when using the mail function in a different process context. See my first mail. > I would *expect* it to go into /var/log/apache2/error.log but I've not tried > building a module in to Apache, so that's not definite. No, it doesn't. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx