By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,647 Members | 1,604 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,647 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.
Jun 11 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Jun 11, 11:05 pm, "BLUE" <bluewrote:
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.

Jun 11 '07 #2

P: n/a
On Jun 11, 9:05 pm, "BLUE" <bluewrote:
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

Jun 11 '07 #3

P: n/a
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.
Jun 12 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.