2

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 application that "you have an email message pending" like that somthing.

Waiting for the reply.....please

4
  • what if I don't have outlook express on my machine? maybe I have linux or mac, or andriod?
    – Muad'Dib
    Commented Jun 24, 2011 at 5:42
  • 1
    i can use smtp server but problem is that my company policy doesnt allow me to use that so i am thought that sending mail by outlook will be the best option. Commented Jun 24, 2011 at 5:56
  • thats fine, but what if i dont have outlook?
    – Muad'Dib
    Commented Jun 24, 2011 at 6:00
  • @Muad'Dib then you can use smtp server .this will help you <codeproject.com/KB/aspnet/Send_Emails_in_ASPNET20.aspx> Commented Jun 24, 2011 at 6:17

2 Answers 2

1

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:[email protected]", 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;
2
  • Is there anything exists where you can import the outlook namespace in c# and use that to send mail. Commented Jun 24, 2011 at 6:15
  • Try googling Microsoft.Office.Interop.Outlook Commented Jun 24, 2011 at 6:24
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.