Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Open new outlook windows with body of email dynamically filled [modified]

Open new outlook windows with body of email dynamically filled [modified]

Scheduled Pinned Locked Moved ASP.NET
databasesysadmintutorialquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ragonastick
    wrote on last edited by
    #1

    Hi guys I am currently working on a web application where people can fill out information in a timesheet, and then it will store that information on a database, and then send a link to it to payroll by email. This is the current code that I have

    Dim msgs As New MailMessage

                        msgs.To = SupervisorEmailGet()
                        msgs.From = "Payroll@server.ca"
                        msgs.Subject = NameTextBox.Text & " Hours for " & Session("date")
    
                        msgs.BodyFormat = MailFormat.Text
                        msgs.Body = "Employee: " & NameTextBox.Text & ControlChars.NewLine & "Department: " & DepartmentDropDownList.SelectedItem.Text & \_
                    ControlChars.NewLine & "Supervisor: " & SupervisorDropDownList.SelectedItem.Text & \_
                    ControlChars.NewLine & "The supervisor of " & NameTextBox.Text & " has viewed their time sheet." & \_
                    " You can view the employees hours at the website shown: http://ServerHostName/TimeSheet/NewTimeSheet.aspx?ID=" & intNewId
    
                        SmtpMail.SmtpServer = "smtp.bellnet.ca"
    
                        SmtpMail.Send(msgs)
                        msgs = Nothing
    

    it works but the person I am working on it for wants the web app to open up their Microsoft Outlook 2007 with a new mail window(like a mailto:), but wants the information filled in dynamically through the program. The reason why they want to have a mail window is just because outlook runs locally, or if the person filling out the timesheet needs to change the body of the email. If anyone knows how to do that I would be happy or if you know how to get the code up top to run locally I would be more than satisfied with that.

    modified on Wednesday, May 27, 2009 4:03 PM

    R 1 Reply Last reply
    0
    • R Ragonastick

      Hi guys I am currently working on a web application where people can fill out information in a timesheet, and then it will store that information on a database, and then send a link to it to payroll by email. This is the current code that I have

      Dim msgs As New MailMessage

                          msgs.To = SupervisorEmailGet()
                          msgs.From = "Payroll@server.ca"
                          msgs.Subject = NameTextBox.Text & " Hours for " & Session("date")
      
                          msgs.BodyFormat = MailFormat.Text
                          msgs.Body = "Employee: " & NameTextBox.Text & ControlChars.NewLine & "Department: " & DepartmentDropDownList.SelectedItem.Text & \_
                      ControlChars.NewLine & "Supervisor: " & SupervisorDropDownList.SelectedItem.Text & \_
                      ControlChars.NewLine & "The supervisor of " & NameTextBox.Text & " has viewed their time sheet." & \_
                      " You can view the employees hours at the website shown: http://ServerHostName/TimeSheet/NewTimeSheet.aspx?ID=" & intNewId
      
                          SmtpMail.SmtpServer = "smtp.bellnet.ca"
      
                          SmtpMail.Send(msgs)
                          msgs = Nothing
      

      it works but the person I am working on it for wants the web app to open up their Microsoft Outlook 2007 with a new mail window(like a mailto:), but wants the information filled in dynamically through the program. The reason why they want to have a mail window is just because outlook runs locally, or if the person filling out the timesheet needs to change the body of the email. If anyone knows how to do that I would be happy or if you know how to get the code up top to run locally I would be more than satisfied with that.

      modified on Wednesday, May 27, 2009 4:03 PM

      R Offline
      R Offline
      Ragonastick
      wrote on last edited by
      #2

      Found it out Here it is for anyone else that wants to know.

      Dim msgs As New MailMessage

                          msgs.To = SupervisorEmailGet()
                          msgs.From = "Payroll@server.ca"
                          msgs.Subject = NameTextBox.Text & " Hours for " & Session("date")
      
                          msgs.BodyFormat = MailFormat.Text
                          msgs.Body = "Employee: " & NameTextBox.Text & ControlChars.NewLine & "Department: " & DepartmentDropDownList.SelectedItem.Text & \_
                      ControlChars.NewLine & "Supervisor: " & SupervisorDropDownList.SelectedItem.Text & \_
                      ControlChars.NewLine & "The supervisor of " & NameTextBox.Text & " has viewed their time sheet." & \_
                      " You can view the employees hours at the website shown: http://ServerHostName/TimeSheet/NewTimeSheet.aspx?ID=" & intNewId
      
                          SmtpMail.SmtpServer = "ServerHostName.smtpname.ca"  
      
                          SmtpMail.Send(msgs)
                          msgs = Nothing
      

      ServerHostName = the name of the server hosting the website. smtpname = The smtp of the server. i.e. smtp.BELLNET.ca

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups