Send an email from a Web Service without having an SMTP server.

B

BLUE

I want to send an email from my web service.

I do not want to act like an email client, giving credentials of an existing
email account to send messages: I would like to send my mail directly to an
SMTP server like if I am myself an SMTP server that is forwarding a mail.

What classes can be used on .NET FW 2?


Thanks,
Luigi.
 
A

Aneesh Pulukkul[MCSD.Net]

I want to send an email from my web service.

I do not want to act like an email client, giving credentials of an existing
email account to send messages: I would like to send my mail directly to an
SMTP server like if I am myself an SMTP server that is forwarding a mail.

What classes can be used on .NET FW 2?

Thanks,
Luigi.

We can use MailMessage class. See http://www.developer.com/net/net/article.php/3511731

But we need to provide the host name, I mean the mailserver name.
 
M

Moty Michaely

I want to send an email from my web service.

I do not want to act like an email client, giving credentials of an existing
email account to send messages: I would like to send my mail directly to an
SMTP server like if I am myself an SMTP server that is forwarding a mail.

What classes can be used on .NET FW 2?

Thanks,
Luigi.

Hi,

I don't think you can avoid connection to an existing SMTP server.
Email forwarding is made by an SMTP server...

If you don't want to be an SMTP server and send mails at the same
time, it's not possible.

If you have an SMTP server to send the mail with, use the
System.Net.Mail namespace MailMessage & SmtpClient classes to deliver
mail messages.
Otherwise, if you want to implement an SMTP server, you should follow
the RFC for SMTP servers and the section of email forwarding.

Hope this helps.
Moty
 
B

BLUE

Using mx1.mail.yahoo.com my message is refused: is there an SMTP with wich
to try?
I'm not sure SmtpClient do not behave like an email client: smtp servers
send messages all over the world without authenticating each other.


If I set UseDefaultCredentials to true
System.Net.CredentialCache.DefaultCredentials are sent, but how can I see
what credentials are sent?
I've seen GetCredential, but I do not know how to set the parameters.


Thanks,
Luigi.
 

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