?
Solved

Open Outlook msg (new) using vb.net in web development

Posted on 2008-02-12
5
Medium Priority
?
1,644 Views
Last Modified: 2010-04-21
I am creating a web app for our intranet site.  Something that would seem simple is causing me a headache.   I would like to create a new email (using outlook 2003/7)  via programming(vb) and populate the subject and body with information.  In essence it would be the same thing as when you click a "mailto" link, just invoked in programming.  

Here's the process which might make the question clear:

1. [user selects internal ftp site from drop down list]
                        ||
2.  [user clicks on generate email button]
                        ||
3.  [button event opens outlook email message and adds username and password to the body and appropriate subject line]
                        ||
4. [user uses contacts to add email addresses, and modify body of email]
                        ||
5. [user sends email]

I need help with step 3.

Thank you for your help!
Ron
0
Comment
Question by:tpta
  • 3
  • 2
5 Comments
 
LVL 2

Expert Comment

by:StanicDejan
ID: 20875699
There's a nice tutorial at:
http://www.aspheute.com/english/20000918.asp

LP,
Dejan
0
 

Author Comment

by:tpta
ID: 20876206
Thanks Dejan.  The tutorial(smtpmail.send) actually sends an email from programming, which I am already able to do.  I just need it to open an outlook new message form.  
0
 
LVL 2

Accepted Solution

by:
StanicDejan earned 2000 total points
ID: 20878376
Hmm...

I'm not sure what do you mean - but if you want to execute mailto:, why don't you just simply execute mailto, e.g.:

    protected void Button1_Click(object sender, EventArgs e)
    {
      Response.Redirect("mailto:dejan@somewhere.net,somebody@somewhere.net?cc=another@xy.net&subject=Hi&body=Hello%0AWorld");
    }


This would open Outlook (if it is the default mail client on the target PC) and prefill:
- recepients with dejan@somewhere.net and somebody@somewhere.net,
- copies (cc) to another@xy.net
- blind copies (bcc) aren't used in the above example, but could be if needed,
- subject to 'Hi'
- message body to:
Hello
World
(you could use more %0A for further line breaks).

Is this what you want?

LP,
Dejan

0
 

Author Comment

by:tpta
ID: 20879040
Works great.  i was hoping for a more elegant solution than Mailto, but this is basically what I was looking for.  I had to modify the line slightly to get the message to open without actually redirecting from the existing page:
Response.Write("<script>window.open('" & mymail & "','_blank');</script>")

Thanks again for your help.
Ron
0
 

Author Closing Comment

by:tpta
ID: 31430169
Thanks for the quick help!
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

No other job is as rewarding and demanding as building an iPhone app is. It is not really in the hands of the developer for the success of an iPhone app. Many factors operate jointly for every iOS application's success in the market.
This article is about the challenges faced by Android app developers.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

593 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question