I'm using 'smtp.mydomain.com' - that's ok.
'localhost' also appears to work.
'mailhost' does not appear to work.
I found both these values used in examples.
Also, is my syntax correct with respect to setting the Timeout?
Thanks,
Kaled.
The name of the server doesn't matter too much, assuming it is the correct name for the machine you are trying to reach. What really matters is that the module is attempting to access an SMTP server through the correct port (usually 25, I believe). I assume the Net::SMTP module handles that for you.
One other thing you might want to code for is that some servers require authentication in order to use SMTP. To do this, you'd use the auth method. Unfortunately, I wasn't able to find any syntax examples for this method, but maybe it looks something like this:
$smtp = Net::SMTP->new($mailserver, Timeout => $timeout, Debug => 1);
$auth = $smtp->Auth($userID,$password);
Fingers crossed,
Kaled.