469,648 Members | 1,436 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,648 developers. It's quick & easy.

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
Feb 9 '08 #1
7 8290
kenobewan
4,871 Expert 4TB
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.
Feb 9 '08 #2
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.
Feb 11 '08 #3
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:sukanya.yelugoti@tanlasolutions.com"> Send Mail</a> . It automatically open the outlookexpress
Feb 11 '08 #4
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:sukanya.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.
Feb 11 '08 #5
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._Application
oApp = New Outlook.Application()


My Code is :

Sub Main()
' Create an Outlook application.
Dim oApp As Outlook._Application
oApp = New Outlook.Application()

' Create a new MailItem.
Dim oMsg As Outlook._MailItem
oMsg = oApp.CreateItem(Outlook.OlItemType.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\Testreport.xls"
' TODO: Replace with attachment name
Dim sDisplayName As String = "Hello.txt"
Dim SDisplayName1 As String = "Testreport.xls"

Dim sBodyLen As String = oMsg.Body.Length
Dim oAttachs As Outlook.Attachments = oMsg.Attachments
Dim oAttach As Outlook.Attachment
oAttach = oAttachs.Add(sSource, , sBodyLen + 1, sDisplayName)

Dim sBodyLen1 As String = oMsg.Body.Length
Dim oAttachs1 As Outlook.Attachments = oMsg.Attachments
Dim oAttach1 As Outlook.Attachment
oAttach1 = oAttachs1.Add(sSource1, , 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
Feb 11 '08 #6
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
Feb 11 '08 #7
Plater
7,872 Expert 4TB
I have merged your threads. In the future, please do not double post your question.

MODERATOR
Feb 11 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

13 posts views Thread by joe215 | last post: by
17 posts views Thread by Bonj | last post: by
1 post views Thread by festivalman | last post: by
7 posts views Thread by Jacques St-Pierre | last post: by
reply views Thread by PW | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.