Talking To An SMTP Server In .NET

V

ViRi

My General Goal is to add e-mail functionality to my program without
using external (smtp) servers. I tried the following:


Lookup MX record: example: mx.home.nl (when looking up home.nl)

connect to mx.home.nl on port 25
mailserver sends welcome

reply with HELO (or EHLO) followed by the hostname
250 +OK response

MAIL FROM:<sender>
250 +OK response

RCPT TO:<remoteaddress>
250 +OK response

DATA
334 i think or alike response, telling to send data, end with crlf
then a . and then a nother crlf
250 +OK response

QUIT
quit response (also 2xx +OK i think)


this is how it should be, i just find that every smtp server does not
allow me to deliver the message for a address on their domain. i have
tried it with my uni's server, the @ home server, can't even connect
to my own domain's mail server :p so i Think i am doing something
wrong.

I have the written code in vb.net, i am just not @ my desk atm.
I have tested it with local SMTP server software, with works prefectly
(they can't deliver the messages eather tho, so i think i am missing
something else.


Any help is appreciated.
 
G

Guest

ViRi said:
My General Goal is to add e-mail functionality to my program without
using external (smtp) servers. I tried the following:


Lookup MX record: example: mx.home.nl (when looking up home.nl)

connect to mx.home.nl on port 25
mailserver sends welcome

reply with HELO (or EHLO) followed by the hostname
250 +OK response

MAIL FROM:<sender>
250 +OK response

RCPT TO:<remoteaddress>
250 +OK response

DATA
334 i think or alike response, telling to send data, end with crlf
then a . and then a nother crlf
250 +OK response

QUIT
quit response (also 2xx +OK i think)


this is how it should be, i just find that every smtp server does not
allow me to deliver the message for a address on their domain. i have
tried it with my uni's server, the @ home server, can't even connect
to my own domain's mail server :p so i Think i am doing something
wrong.

I have the written code in vb.net, i am just not @ my desk atm.
I have tested it with local SMTP server software, with works prefectly
(they can't deliver the messages eather tho, so i think i am missing
something else.


Any help is appreciated.

Do you mean deliver messages from or to accounts on the domain ? I would
mostly expect it to deliver messages to local accounts but not often to
allow mail from those accounts to be forwarded to prevent the servers use by
spammers. Have you tried using telnet to verify it works OK that way ?
 

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