开发者

Sending email using outlook express in asp.net c#

I would like to know how to open Outlook Express mail client for mailing through web application in Asp.Net? I mean to say, can we call Outlook Express to send mail through web application?

For example, when there is need to send mail, I will click on a button which will open Outlook Express's New Message window. Now my message should go through Outlook Express. I will be making use of Outlook Express Address Book to store my email contacts. Now if I get any mail it will come in Outlook Express but popup message should come in my Web 开发者_Python百科application that "you have an email message pending" like that somthing.

Waiting for the reply.....please


To answer you first question: Yes it is possible to send an e-mail from a web application. Try this (from the client side if you are using Silverlight):

HtmlPage.Window.Navigate(new Uri("mailto:somemailaddress@gmail.com", UriKind.Absolute));

Or just have a mailto link (in HTML): - http://webdesign.about.com/od/beginningtutorials/a/aabegin100299.htm

However, implementing a web service to send the mail is probably better. Try these (they are for Silverlight, but you'll get the idea): - http://deepumi.wordpress.com/tag/send-email-from-silverlight/ - http://www.michaelsnow.com/2010/06/10/silverlight-tip-of-the-day-30-sending-email-from-silverlight/

If your company does not allow you access to an SMTP server you can use Google as one. Just create a gmail account and set up the server like this (with your gmail account name and password). I think they limit the amount of mails sent out to 100 per day.

    _mailClient = new SmtpClient();
    _mailClient.Host = "smtp.gmail.com";
    _mailClient.Port = 587;
    _mailClient.EnableSsl = true;
    _mailClient.UseDefaultCredentials = false;
    _mailClient.Credentials = new NetworkCredential(username, password);
    _mailClient.DeliveryMethod = SmtpDeliveryMethod.Network;


Take a look at this post. You can even edit the HTML message and then, through Javascript, 'navigate' to an anchor tag that points to a mailto: location. As for the pop-ups, you need to integrate either the navigator or the webpage with the POP/IMAP/whatever mailserver where the message will be stored/retrieved/received.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜