SMTP password

C

copyco

I'm trying to write code that will send an e-mail using WinSock.
Problem is that my server requires my password for outgoing e-mail.
What is the SMTP format for supplying the password to the server?? I've
checked out http://www.faqs.org/rfcs/rfc821.html but there is
absoulutely nothing concerning authentication. Any help appreciated.
 
P

Patrick Steele [MVP]

I'm trying to write code that will send an e-mail using WinSock.
Problem is that my server requires my password for outgoing e-mail.
What is the SMTP format for supplying the password to the server?? I've
checked out http://www.faqs.org/rfcs/rfc821.html but there is
absoulutely nothing concerning authentication. Any help appreciated.

Perhaps it's this one:

"RFC 2554 - SMTP Service Extension for Authentication"
http://www.faqs.org/rfcs/rfc2554.html
 
C

Chad Z. Hower aka Kudzu

copyco said:
I'm trying to write code that will send an e-mail using WinSock.
Problem is that my server requires my password for outgoing e-mail.
What is the SMTP format for supplying the password to the server?? I've
checked out http://www.faqs.org/rfcs/rfc821.html but there is
absoulutely nothing concerning authentication. Any help appreciated.

There are about half a dozen ways to specify authentication for SMTP. Only
LOGIN is simple.

Use Indy instead, its free and supports all the common methods as well as
some uncommon ones. Its also free. ;)

http://www.indyproject.org/
 
C

copyco

Yeah, I'm finding that examples given for SMTP authentication just
aren't working on my server. How does my e-mail client do it then?
 
C

copyco

Ok, below is a windows script file I got working. It does what I want
which is to send out an e-mail message. Is there any way to do this in
a windows application? The only think I'm missing is how to get the
authentication to work. I suppose I could somehow shell out to run this
script, but wouldn't that be the hard way? Thanks for any help.


Set objEmail = CreateObject("CDO.Message")
objEmail.From = "my_email@my_isp.net"
objEmail.To = "my_email@my_isp.net"
objEmail.Subject = "Server down"
objEmail.Textbody = "Server1 is no longer accessible over the network."

objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"my.smtp.server"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"my_email@my_isp.net"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"my_password"

objEmail.Configuration.Fields.Update

objEmail.Send
 
C

Chad Z. Hower aka Kudzu

copyco said:
Yeah, I'm finding that examples given for SMTP authentication just

Your server probably requires a differenet auth type.
aren't working on my server. How does my e-mail client do it then?

Its probably has code to perform auth.
 
C

Chad Z. Hower aka Kudzu

copyco said:
Ok, below is a windows script file I got working. It does what I want
which is to send out an e-mail message. Is there any way to do this in
a windows application? The only think I'm missing is how to get the
authentication to work. I suppose I could somehow shell out to run this
script, but wouldn't that be the hard way? Thanks for any help.

I told you how. :)

Impelementing all the popular auth methods would take you a few weeks
mininmum. Indy already does all this for you - and its free. It doesnt
require CDO either.

http://www.indyproject.org/

There is even an SMTP demo with source at:
http://www.atozed.com/indy/
 
C

copyco

Thanks. Indy looks like a pretty cool tool. However there aren't many
demos available for VB.NET and the ones that are, are for a newer
version of Visual Studio :-( So it's gonna take me a while to figure
out how to use this. Thanks again.
 
L

lancer

Thanks. Indy looks like a pretty cool tool. However there aren't
many
demos available for VB.NET and the ones that are, are for a newer
version of
Visual Studio :-( So it's gonna take me a while to figure
out how to use this. Thanks again.

I've you're looking for a commercial quality tool,
you may want to try IP*Works! The .Net Edition contains 39 differenet demos (78
if you count both C# and VB.Net), several of which are for the SMTP component of
the toolkit.

The components will allow you to see what type of authentication
the server supports through the PITrail event. The SMTP component supports the
most popular LOGIN and CRAM-MD5 authentication methods.

Regards,
Lance
R.
/n software
http://www.nsoftware.com/

-
 
C

Chad Z. Hower aka Kudzu

copyco said:
Thanks. Indy looks like a pretty cool tool. However there aren't many
Thanks.

demos available for VB.NET and the ones that are, are for a newer

Well there is a mail demo - and more are coming. And you can always ask on
the Indy newsgroups. :)
version of Visual Studio :-( So it's gonna take me a while to figure
out how to use this. Thanks again.

Indy does however require .net framework 1.1 - I dont think earlier versions
of Visual Studio support 1.1?
 
S

Sueffel

copyco said:
I'm trying to write code that will send an e-mail using WinSock.
Problem is that my server requires my password for outgoing e-mail.
What is the SMTP format for supplying the password to the server?? I've
checked out http://www.faqs.org/rfcs/rfc821.html but there is
absoulutely nothing concerning authentication. Any help appreciated.

Base64 encoding, which is the same encoding you must use for all
attachements.

HTH,
Sueffel
 
S

Sueffel

Chad Z. Hower aka Kudzu said:
I told you how. :)

Impelementing all the popular auth methods would take you a few weeks
mininmum. Indy already does all this for you - and its free. It doesnt
require CDO either.

BTW, took me 2 days to write an SMTP component from scratch. I think it's
great that you guys have done this IndyProject, but sometimes people want
the satisfaction of doing it themselves, and no one can argue with that.

Sueffel
 
C

Chad Z. Hower aka Kudzu

Sueffel said:
Base64 encoding, which is the same encoding you must use for all
attachements.

Only for LOGIN auth. That wont help with servers that use much newer and more
advanced schemes.
 
C

Chad Z. Hower aka Kudzu

Sueffel said:
BTW, took me 2 days to write an SMTP component from scratch. I think it's
great that you guys have done this IndyProject, but sometimes people want
the satisfaction of doing it themselves, and no one can argue with that.

Yes, there is a certain satisfaction. But as you find things it doesnt do -
it a major pain to have it as a liability. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top