Opening email client window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Zack

    #1

    Opening email client window

    I am totally new to microsoft technolgy so please bear
    with me. All i want to do is to open an email client
    software tool (outlook or outlook express) from inside my
    application so that people could send email from within my
    application. How can I do that? Please help
  • William Ryan

    #2
    Opening email client window

    Writing your own is pretty simple....

    Basically, create a form to mimic An outlook form..


    //I rewrote my VB Code on the fly, might have a typo but
    should work.

    using System.Web.Mail

    Dim m As New MailMessage //MailMessage m = new
    MailMessage();
    private void btnSend_Click(B yVal sender As System.Object,
    ByVal e As System.EventArg s)
    m.To = tbTo.Text
    m.From = tbFrom.Text
    m.Subject = tbSubject.Text
    m.Body = rtb.Text
    System.Web.Mail .SmtpMail.Send( m)//Key Line here
    this.Dispose()

    YOu can also add attachments, CC support and BCC support.

    Hopefully this helps. Your other alternative is to
    reference the Outlook library and create an outlook
    message, but if you are just starting, this is a much
    easier approach.

    Good Luck,

    Bill
    [color=blue]
    >-----Original Message-----
    >I am totally new to microsoft technolgy so please bear
    >with me. All i want to do is to open an email client
    >software tool (outlook or outlook express) from inside my
    >application so that people could send email from within[/color]
    my[color=blue]
    >application. How can I do that? Please help
    >.
    >[/color]

    Comment

    • Daniel O'Connell

      #3
      Re: Opening email client window

      if you just want to use outlook\outlook express (pretty sure outlook works
      with this too, don't have it on this machine to test)
      this code will do it, you'll have to put a little work into filling in the
      address & subject, but it will work.
      System.Diagnost ics.Process.Sta rt("mailto:emai l@address?subje ct=my subject");

      "Zack" <sakawal@yahoo. com> wrote in message
      news:03f601c36c d2$d74dadb0$a30 1280a@phx.gbl.. .[color=blue]
      > I am totally new to microsoft technolgy so please bear
      > with me. All i want to do is to open an email client
      > software tool (outlook or outlook express) from inside my
      > application so that people could send email from within my
      > application. How can I do that? Please help[/color]


      Comment

      • Daniel O'Connell

        #4
        Re: Opening email client window

        forgot to mention, in theory, that should work with any mail application
        that provides a mailto app.
        "Daniel O'Connell" <onyxkirx@comca st.net> wrote in message
        news:9N83b.2113 55$cF.68209@rwc rnsc53...[color=blue]
        > if you just want to use outlook\outlook express (pretty sure outlook works
        > with this too, don't have it on this machine to test)
        > this code will do it, you'll have to put a little work into filling in the
        > address & subject, but it will work.
        > System.Diagnost ics.Process.Sta rt("mailto:emai l@address?subje ct=my[/color]
        subject");[color=blue]
        >
        > "Zack" <sakawal@yahoo. com> wrote in message
        > news:03f601c36c d2$d74dadb0$a30 1280a@phx.gbl.. .[color=green]
        > > I am totally new to microsoft technolgy so please bear
        > > with me. All i want to do is to open an email client
        > > software tool (outlook or outlook express) from inside my
        > > application so that people could send email from within my
        > > application. How can I do that? Please help[/color]
        >
        >[/color]


        Comment

        • Eric Cadwell

          #5
          Re: Opening email client window

          > >
          System.Diagnost ics.Process.Sta rt("mailto:emai l@address?subje ct=mysubject");

          FYI - the length of a URL is limited to 255 char's. If you need to pass a
          large amount of data this approach won't work.

          Eric Cadwell



          Comment

          • Eric Cadwell

            #6
            Re: Opening email client window

            We had a contractor implement a MailItem class using a URL. It wasn't until
            much later that we realized the error of our ways.

            We were also passing in the body as you showed:
            string.Format(" mailto:{0}?Subj ect={1}&Body={2 }", this.To, this.Subject,
            this.Body);

            The body parameter in our case was 1000s of chars in length.

            -Eric


            Comment

            Working...