Page 1 of 1

Sending email without an SMTP server

Posted: Wed Mar 24, 2004 2:43 pm
by Karbon
Currently I'm using Blat to send out email but I'd like to find a library or other solution that doesn't require an SMTP server. Can anyone make any suggestions?

Thanks!

Posted: Wed Mar 24, 2004 4:58 pm
by dell_jockey
Mitch,

do you mean that you don't want your application (resp. Blat) to have to authenticate itself against an SMTP server out there?
In that case, you need to encapsulate a (lightweight?) SMTP server within your application. SMTP server apparently don't need to authenticate against each other.

You might want to peruse what Google has to offer:
http://www.google.de/search?q=embeddabl ... l=de&meta=

Posted: Wed Mar 24, 2004 5:18 pm
by Berikco
You wil need to get the MX records of the receiver domain (take a look at nslookup in windows nt/xp/2000/2003
Than you wil have to connect tho this servers one by one until one of them respond, lowest priority server must be connected first.
And if your lucky, he will accept your e-mail.

Why lucky, coz more and more providers refuse incomming smtp connections - not from there own ip ranges - if they have a dynamic ip address.

Why...spam...

So better use the isp smtp server for relaying.

Posted: Wed Mar 24, 2004 5:33 pm
by Karbon
I'm trying to get around users having to put in their mail server address. It seems this is quite a point of confusion with a *lot* of users that buy my software!

I'll look into embedding an SMTP server, but I had hoped to avoid that type of bloat...

Thanks guys!

Posted: Wed Mar 24, 2004 6:05 pm
by PolyVector
if you have good mail hosting you could try what I do... Create an email account just for your programs to send mail through... something like sendmail@yourcompany.com
then have all your programs use that... :)

Posted: Wed Mar 24, 2004 6:11 pm
by Fred
I think you will have to recode the STMP server part which connect directly to the destination user smtp server. This is not hard but have a lot of drawback:

- If the destination server is down for any reason when you try, you will have an error, instead of using the smtp server features which is to put the mail in queue to retry later
- If the destination server is slow, then you will have to wait a lot before closing your email client (ISP smtp servers are of course very fast to avoid that)
- When sending to several people (CC/BCC) you will have to send the mail as many time than there is users (connect to each user smtp servers).

So a good solution would be to host an smtp server like exim or sendmail and put your address as default. But if one of your user send spams, you will be tricked. So... there is no easy solution instead using the ISP smtp server.

Posted: Wed Mar 24, 2004 10:16 pm
by GedB
Karbon,

Have you considered MAPI?

If your client is using Outlook Express then this will be available.

There are ways to check the registry to see if it is present, so you could check first then ask for smtp settings if it isn't present.

Here is the MSDN reference:
http://msdn.microsoft.com/library/defau ... erface.asp

Ignore all the OLE stuff and look in the reference. Beneath the layers it can all be done using C calls.

I wrote a mail shot using Euphoria and Simple MAPI years ago. It isn't too difficult.

Posted: Thu Mar 25, 2004 2:25 am
by Karbon
Thanks for all the suggestions!

Posted: Fri Mar 26, 2004 6:41 am
by Max.
After reading the postings, maybe a kind of compromise could help you?

The user enters his email address, then you figure out his mail exchange server for him...

The problems others mentioned are very real now; I used to run a mailing list hosted on a server with dynamic IP. Finally, only maybe 40-50% of all mail servers accepted and because it were mostly the bigger ones like hotmail.com, aol.com and so on a lot more users were affected by it (maybe 3/4th). I switched to a static IP then...

Posted: Fri Mar 26, 2004 2:45 pm
by pthien
How do the ISP's know you're using a dynamic address? I used dyndns.org to register a subdomain (example.dyndns.org). If I wrote my own mail server code, would the ISP mail servers accept my connection from my dynamic IP as it can be reversed to example.dyndns.org, or would there be another holdup?

Thanks,
Phil

Posted: Fri Mar 26, 2004 3:53 pm
by Karbon
I'm going to have to stick with requiring the user to put in their ISP's SMTP server.

Many ISPs here in the US have taken to denying any outbound connections on port 25 to anything but *their* mail server - so users of those ISPs would not be able to send mail through any other SMTP server. I guess it probably does help fight SPAM, but it cripples a lot of people too.

I'll just add error crazy amounts of error checking and hope for the best!

Posted: Fri Mar 26, 2004 5:05 pm
by dell_jockey
Mitch,

one suggestion: after configuring your application, let the user allow your application to send a verification mail to themselves. This would reassure your customer that all went well.

Posted: Fri Mar 26, 2004 10:32 pm
by Max.
pthien wrote:How do the ISP's know you're using a dynamic address? I used dyndns.org to register a subdomain (example.dyndns.org). If I wrote my own mail server code, would the ISP mail servers accept my connection from my dynamic IP as it can be reversed to example.dyndns.org, or would there be another holdup?
AFAIK, they usually use IP address ranges for dial ups. While the old mailing list server, using dial-up & a dyndns DNS record was rejected, the new server is allowed - no problems at all, with neither big providers as small providers. The only difference is the static IP address of the new server, as I only have a dyndns DNS record for this one as well.