Sending Email via exchange Server

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

    Sending Email via exchange Server

    Does anyone know how to send a email from VB.net vie the exchange and the
    outlook client setup in the machine where the application is going to run. I
    tried the web thing but it did not work, the mail need to go vie exchannge.

    Thanks


  • J. Clay

    #2
    Re: Sending Email via exchange Server

    This is the Procedure I use and it work fine. Just make sure you put the
    Imports statement at the top of your class/module

    HTH,
    Jim

    Imports System.Web.Mail

    Private Sub SendMailMessage (ByVal MailTo As String, ByVal Subject As String,
    ByVal HTMLMessage As String)
    Dim MailMessage As Web.Mail.MailMe ssage = New Web.Mail.MailMe ssage

    With MailMessage
    .From = "SysAdmin@YourD omain.com"
    .To = MailTo
    .Subject = Subject
    .BodyFormat = MailFormat.Html
    .Body = HTMLMessage
    End With

    Web.Mail.SmtpMa il.SmtpServer = "ExchangeServer Name"
    Web.Mail.SmtpMa il.Send(MailMes sage)
    End Sub



    "Carlos" <cp@swa.com> wrote in message
    news:e2AFGDqoFH A.860@TK2MSFTNG P12.phx.gbl...[color=blue]
    > Does anyone know how to send a email from VB.net vie the exchange and the
    > outlook client setup in the machine where the application is going to run.
    > I tried the web thing but it did not work, the mail need to go vie
    > exchannge.
    >
    > Thanks
    >
    >[/color]



    Comment

    • Peter Huang [MSFT]

      #3
      RE: Sending Email via exchange Server

      Hi

      Also I think you may try the WebDav approach.
      Sending a Message (WebDAV)

      esdk_sending_a_ message_webdav. asp

      Best regards,

      Peter Huang
      Microsoft Online Partner Support

      Get Secure! - www.microsoft.com/security
      This posting is provided "AS IS" with no warranties, and confers no rights.

      Comment

      Working...