locked
open outlook with values filled in RRS feed

  • Question

  • User1115482847 posted

    Hi,

    We're building a page, where the user will fill in certain information, such as their email, some comments and require them to attach a file.  Then the user will hit a button which will cause outlook to open with the values filled in and attachement there as well.  Is there a way to do this, to fire up outlook and get the values and attachment in?  Is there a way to do this using mailto (including attachment) incase they do not use outlook, as right now the client keeps saying they only want outlook, but they're not 100% sure.

     

    Thanks. 

    Friday, November 3, 2006 11:49 AM

All replies

  • User-1348799698 posted

    There is not a way to attach files to an outlook session using a link.

     See this discussion of the mailto syntax http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/predefined/mailto.asp

    Have you considered sending the email from the server?

    --JJ

    Friday, November 3, 2006 3:34 PM
  • User1273521863 posted

    Hi,

    I want to open outlook window to send a mail in ASP.NET  programming. Please help me if anybody can.

    please show me the code if anybody can give.

     

    Thursday, April 26, 2007 1:11 AM
  • User1986272753 posted
    This should spawn on the client machine not the web server. But then im using an all in one so ....
    dont forget to import the outlook namespace at the top of your codebehind page

    Imports outlook

    Dim objOutlk As New Outlook.Application 'Outlook
    Const olMailItem As Integer = 0
    Dim objMail As New System.Object
    objMail = objOutlk.CreateItem(olMailItem) 'Email item
    objMail.To = emaila.Text
    objMail.cc = "" 'Enter an address here To include a carbon copy; bcc is For blind carbon copy's
    'Set up Subject Line
    objMail.subject = "Quality Assurance Letter"
    'To add an attachment, use:
    'objMail.attachments.add("C:\MyAttachmentFile.txt")
    dim msg as string
    msg = "body test msg"
    objMail.body = msg
    'Use this To display before sending, otherwise call objMail.Send to send without reviewing
    objMail.display()
    'Use this To display before sending, otherwise call objMail.Send to send without reviewing
    'Clean up
    objMail = Nothing
    objOutlk = Nothing

    hope this helps

    Thursday, April 26, 2007 1:00 PM
  • User1986272753 posted
    This should spawn on the client machine not the web server. But then im using an all in one so ....
    dont forget to import the outlook namespace at the top of your codebehind page

    Imports outlook

    Dim objOutlk As New Outlook.Application 'Outlook
    Const olMailItem As Integer = 0
    Dim objMail As New System.Object
    objMail = objOutlk.CreateItem(olMailItem) 'Email item
    objMail.To = emaila.Text
    objMail.cc = "" 'Enter an address here To include a carbon copy; bcc is For blind carbon copy's
    'Set up Subject Line
    objMail.subject = "Quality Assurance Letter"
    'To add an attachment, use:
    'objMail.attachments.add("C:\MyAttachmentFile.txt")
    dim msg as string
    msg = "body test msg"
    objMail.body = msg
    'Use this To display before sending, otherwise call objMail.Send to send without reviewing
    objMail.display()
    'Use this To display before sending, otherwise call objMail.Send to send without reviewing
    'Clean up
    objMail = Nothing
    objOutlk = Nothing

    hope this helps
    Thursday, April 26, 2007 1:02 PM
  • User-1348799698 posted

    If you want to send an email from code use the system.net.mail namespace and the methods / objects there.  Otherwise use the mailto href as I described earlier.

     

    --JJ 

    Thursday, April 26, 2007 10:08 PM
  • User-7747702 posted

    hi,

    im having the same problem.

    users are required to fill in all data in the web form, and when a button is clicked, it will store all data in the db and as well as open client's outlook with all fields filled in.

    the reason i wanted to do this is to keep a copy in the sent item.

    my question is, if im using asp.net to send email through an exchange server, will the client's outlook have a copy in his sent folder??

     thanks in advance

    Wednesday, July 4, 2007 5:40 AM
  • User-1348799698 posted

    No, the client isn't actually sending the email, so they will not have a sent item in their exchange folder.  You can BCC them, or have a specific mailbox set up to send copies to.  

     --JJ
     

    Wednesday, July 4, 2007 4:28 PM
  • User-7747702 posted

    Hi, so you mean that there is no possible way to use the xchange server to send email promatically and when the client open up their outlook, they will be able to download the sent items into their sent mails foldeR?

     

    thanks

    Wednesday, July 11, 2007 3:37 AM
  • User-1348799698 posted

    I won't say there is no possible way.  There is a discussion among microsofties that discusses using webdav to send an email and copy it to a specific folder

    It essentially requires that your exchange server have a web interface.  You use httprequests to post data to an exchange page for the user.

    Start at the top and keep reading.

     

    --JJ 

     

     



     

    Friday, July 13, 2007 6:59 PM
  • User-898628695 posted

    Hi,

    Thank you for you help.

    Can you help me in just opening(not sending ) a new outlook e-mail with values filled in using C# ASP.net.

    I am already aware of the html tag "mailto"

    Wednesday, January 21, 2009 11:21 AM
  • User-2080168305 posted

    so have u got final answer?

    I facing same problem. pls let me know if u got.


    Saturday, April 24, 2010 6:52 AM
  • User-2080168305 posted

    so have u got final answer?

    I facing same problem. pls let me know if u got.


    Saturday, April 24, 2010 6:54 AM
  • User-817787195 posted

    I am going to pretend that this discussion is not happening.... Correct me if I'm wrong but are you really asking that a web application open outlook?  Not just a smiple mailto: tag but to have an outside web application open outlook and allow Joe Schmoe send an email to anyone in the exchange address book?  Please tell me this is not what you want.... What if they are not an employee and don't have outlook installed but you are going to serve up the companies email addresses to them?

    Make a web form, have them type in the email addresses, or if you know of the common ones needed make a table of them, query them in a listbox and allow the user to select them....

    I can't believe this is still a question after all these years.

     

    Try this!

    http://www.java2s.com/Code/ASP/Components/SendoutemailincodebehindC.htm

    http://www.systemwebmail.com/

     

     

     

    Thursday, April 29, 2010 9:43 AM
  • User-1271217402 posted

    Wow, commadercody. That seems pretty presumptuous to take that kind of tone with someone and make all sorts of assumptions about what their application is doing and who will have access to it.  I don’t know what the original poster’s purposes are, but I came upon this post, because I am looking for a solution for my company’s intranet application on the backend of our website.  Our site is written in VB.net, and I need to populate an html formatted body message with information from our SQL server paired with information provided by our users (who happen to be password authenticated salespeople that work for our company).  In our case it is imperative that the website launch a new mail message in the user’s Outlook account, because it needs to be saved in their sent e-mail messages and it feeds into a third party CRM system.

    Mailto: is not an option, because it doesn’t allow html tags in the body message.  Already tried switching those to their ASCII counterparts, still didn’t work.

    SMTP is not an option, because you can only send you can’t open and then send.  Unless you know of a way to do that, which would be awesome.

    I have tried adding a reference to Microsoft.Office.Interop.Outlook and using the Outlook objects.  This compiles, but throws 401 errors when it is actually used.

    So I am left searching for the same thing that the original poster is looking for.  I am able to export tasks, calendar events, and contacts from our website to Outlook.  Why not mail messages?

    Essentially, I am just looking for an alternative to mailto: that will allow html formatting in the body message.

    So do you have any suggestions, or are you still set on dismissing the possibility of a legitimate need for this existing?


    Wednesday, May 5, 2010 9:56 PM
  • User708250839 posted

     Hi abransom ,

    could you please let me know if you got a solution for this. Can you share with me please as I am having the same problem.

    Friday, May 21, 2010 10:27 AM