Sending Email in vb .Net 2003 Using OutLook Express

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Paridevi
    New Member
    • Feb 2008
    • 15

    Sending Email in vb .Net 2003 Using OutLook Express

    Hai ,

    i want to send email in .Net Using OutLook Express,My Project is Web Application using vb.Net 2003 with SQL Server 2000.I have searched a lot in Google, but ican't get any details. Pls its urgent for me. Can any one give me any idea about this. Thanks in advance

    Pari
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Originally posted by Paridevi
    Hai ,

    i want to send email in .Net Using OutLook Express,My Project is Web Application using vb.Net 2003 with SQL Server 2000.I have searched a lot in Google, but ican't get any details. Pls its urgent for me. Can any one give me any idea about this. Thanks in advance

    Pari
    Do you mean through office.interop? Do you have office installed? Otherwise try send an email using smtp. HTH.

    Comment

    • Paridevi
      New Member
      • Feb 2008
      • 15

      #3
      Originally posted by kenobewan
      Do you mean through office.interop? Do you have office installed? Otherwise try send an email using smtp. HTH.
      Thanks for your idea. But i can't Get u. Can you send me the code for this using SMTP.For SMTP i want SMTP Server na.

      Comment

      • sukanyareddy
        New Member
        • Feb 2008
        • 1

        #4
        Originally posted by Paridevi
        Hai ,

        i want to send email in .Net Using OutLook Express,My Project is Web Application using vb.Net 2003 with SQL Server 2000.I have searched a lot in Google, but ican't get any details. Pls its urgent for me. Can any one give me any idea about this. Thanks in advance

        Pari
        Hi Paridevi,
        if ur need is to send a mail when u click on hyperlink. u just take an anchor tag like <a runat="server" id="achsendmail " href="mailto:su kanya.yelugoti@ tanlasolutions. com">Send Mail</a> . It automatically open the outlookexpress

        Comment

        • Paridevi
          New Member
          • Feb 2008
          • 15

          #5
          Originally posted by sukanyareddy
          Hi Paridevi,
          if ur need is to send a mail when u click on hyperlink. u just take an anchor tag like <a runat="server" id="achsendmail " href="mailto:su kanya.yelugoti@ tanlasolutions. com">Send Mail</a> . It automatically open the outlookexpress
          Thanks for your help.i have one doubt, Shall i have to import any name space to add this anchor tag.

          Comment

          • Paridevi
            New Member
            • Feb 2008
            • 15

            #6
            Sending Email in vb .Net 2003 Using OutLook Express

            hai ,
            Still i am having one doubt in sending email with Attachment in vb.Net.i used System.Web.mail name space and added outlook reference. Still
            i m getting Server Application Error in this line

            Dim oApp As Outlook._Applic ation
            oApp = New Outlook.Applica tion()


            My Code is :

            Sub Main()
            ' Create an Outlook application.
            Dim oApp As Outlook._Applic ation
            oApp = New Outlook.Applica tion()

            ' Create a new MailItem.
            Dim oMsg As Outlook._MailIt em
            oMsg = oApp.CreateItem (Outlook.OlItem Type.olMailItem )
            oMsg.Subject = "Test email with attachment Visual Basic .NET"
            oMsg.Body = "Test email" & vbCr & vbCr

            ' TODO: Replace with a valid e-mail address.
            oMsg.To = "test@email.com "

            ' Add an attachment
            ' TODO: Replace with a valid attachment path.
            Dim sSource As String = "C:\Temp\Hello. txt"
            Dim sSource1 As String = "C:\Temp\Testre port.xls"
            ' TODO: Replace with attachment name
            Dim sDisplayName As String = "Hello.txt"
            Dim SDisplayName1 As String = "Testreport.xls "

            Dim sBodyLen As String = oMsg.Body.Lengt h
            Dim oAttachs As Outlook.Attachm ents = oMsg.Attachment s
            Dim oAttach As Outlook.Attachm ent
            oAttach = oAttachs.Add(sS ource, , sBodyLen + 1, sDisplayName)

            Dim sBodyLen1 As String = oMsg.Body.Lengt h
            Dim oAttachs1 As Outlook.Attachm ents = oMsg.Attachment s
            Dim oAttach1 As Outlook.Attachm ent
            oAttach1 = oAttachs1.Add(s Source1, , sBodyLen1 + 1, sDisplayName1)

            ' Send
            oMsg.Send()

            please any one help me.It's urgent for me to do this work. thanks in advance

            regards
            pari

            Comment

            • Paridevi
              New Member
              • Feb 2008
              • 15

              #7
              Thanks for your help.i have one doubt, Shall i have to import any name space to add this anchor tag.But still i can't attach any file with that anchor tag. i can open the OutLookExpress window with that tag. actually i want to attach file automatically from code itself. can u give any suggestions

              Comment

              • Plater
                Recognized Expert Expert
                • Apr 2007
                • 7872

                #8
                I have merged your threads. In the future, please do not double post your question.

                MODERATOR

                Comment

                Working...