By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,144 Members | 1,250 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,144 IT Pros & Developers. It's quick & easy.

Sending Email in vb .Net 2003 Using OutLook Express

P: 15
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
Share this Question
Share on Google+
7 Replies


kenobewan
Expert 2.5K+
P: 4,871
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

P: 15
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

P: 1
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

P: 15
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

P: 15
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

P: 15
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
Expert 5K+
P: 7,872
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.