Sending email without an SMTP server

Everything else that doesn't fall into one of the other PB categories.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Sending email without an SMTP server

Post 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!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post 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=
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post 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.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post 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!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
PolyVector
Enthusiast
Enthusiast
Posts: 499
Joined: Wed Sep 17, 2003 9:17 pm
Location: Southern California
Contact:

Post 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... :)
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post 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.
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post 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.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Thanks for all the suggestions!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Max.
Enthusiast
Enthusiast
Posts: 225
Joined: Fri Apr 25, 2003 8:39 pm

Post 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...
Athlon64 3800+ · 1 GB RAM · Radeon X800 XL · Win XP Prof/SP1+IE6.0/Firefox · PB 3.94/4.0
Intel Centrino 1.4 MHz · 1.5 GB RAM · Radeon 9000 Mobility · Win XP Prof/SP2+IE6.0/Firefox · PB 3.94/4.0
pthien
Enthusiast
Enthusiast
Posts: 150
Joined: Sun Jun 29, 2003 9:39 pm

Post 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
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post 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!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post 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.
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
Max.
Enthusiast
Enthusiast
Posts: 225
Joined: Fri Apr 25, 2003 8:39 pm

Post 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.
Athlon64 3800+ · 1 GB RAM · Radeon X800 XL · Win XP Prof/SP1+IE6.0/Firefox · PB 3.94/4.0
Intel Centrino 1.4 MHz · 1.5 GB RAM · Radeon 9000 Mobility · Win XP Prof/SP2+IE6.0/Firefox · PB 3.94/4.0
Post Reply