SetSMTPServer

E-mail
Aptilis 1

SetSMTPServer(SMTPserver)

implemented: aptilis v1.041 build 0015

SetSMTPServer allows you to override the default SMTP server indicated in the file:
aptilis.mail

The format for aptilis.mail is described with the sendmail command.

Return value:
0 if everything was OK, -1 if there wasn't enough memory to allocate your server name.

Example: (works from my home where I use Pipex as my ISP)

sub main

print("1. Default gateway: ", getSMTPServer()$, "\n")

setSmtpServer("smtp.dial.pipex.com")
print("2. New gateway: ", getSMTPServer()$, "\n")

r = sendMail("teebo@mw-interactive.co.uk","adw59@dial.pipex.com","test1","message du texte 1...\nEn esperant que ca marche!!!", "someone@glaine.net")
if r != 0
print("r=", r$, "\n")
print("errno=", _errno$, "\n")
end if

end main

SMTP is the Internet protocol used to send e-mails.
To send an e-mail, you need to connect to a server that uses the SMTP protocol. That's what most e-mail programs do, as well as the aptilis sendmail command.

This command can be particularly useful if you are on a foreign server and the SMTP server it uses won't accept the from address you specify as the 'from' parameter of the sendmail command.

By specifying a mail server that knows you (or the address you use as 'from'), everything should be hunky-dory.
Unfortunately some ISPs (Internet Service Providers) still won't allow you to use their SMTP server if you're not connecting from one of their dial-up accounts... The solution to that is to use one of the free e-mail providers out there who, when they offer SMTP services (So that you can use Eudora for example) are less fussy about where you're coming from.

See also:
- GetSMTPServer to get the current SMTP server.
- sendmail to send an e-mail. - Here is how you can find out the smtp server you use:
(Let's assume you are using Eudora 3.0, if you're not, the procedure should be similar anyway)
Click 'Tools'
Select 'Options...'
Select 'Hosts'
The SMTP server you're connecting to should be in there.

Notes:
To my knowledge, here are the free a-mail providers which will allow you to use their SMTP servers:
http://www.HotPop.com
The only catch being that they may add some text at the end of your e-mails for advertising purposes. (That's how they make their money)
If you know a service and would like to see it been mentioned here, or if the conditions of the services mentioned here have changed please don't hesistate to send me an e-mail at teebo@mw-interactive.co.uk

See also: sendMail, readEMails.