473,327 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Email using .Net

shweta123
692 Expert 512MB
Hi ,
Can anybody tell me how to send email using .Net?

I have written this code.But its not sending any email.

' 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 = "Send Attachment Using OOM in Visual Basic .NET"
oMsg.Body = "Hello World" & vbCr & vbCr
' TODO: Replace with a valid e-mail address.
oMsg.To = "shweta@xyz.com"
' Add an attachment
' TODO: Replace with a valid attachment path.
'Dim sSource As String = "C:\abc.txt"
' TODO: Replace with attachment name
Dim sDisplayName As String = "Hello.txt"

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)
' Send
oMsg.Send()
' Clean up
oApp = Nothing
oMsg = Nothing
' oAttach = Nothing
' oAttachs = Nothing

Plz help!!!

Shweta
Dec 22 '06 #1
4 1469
kenobewan
4,871 Expert 4TB
The standard way is to use an smtp server, here is an example:
Send Mail in VB.net, ASP.net

Hope that this helps.
Dec 23 '06 #2
shweta123
692 Expert 512MB
hi,
Thanks for the help .I need to send it to the Exchange server.So is it one ways to send the mails to the Exchange server ?


Shweta
Dec 25 '06 #3
kenobewan
4,871 Expert 4TB
I use smtp and we have an exchange mail server.

Hope that this helps.
Dec 25 '06 #4
karthi84
271 100+
y not u try with authentication codes along with your code to access it.
Dec 28 '06 #5

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

Similar topics

12
by: Chuck Anderson | last post by:
Can anyone point me in the right direction? I want to use Php to automate confirmation of someone joining an email list by them replying to an email (so they don't have to have a browser?). I...
7
by: BenignVanilla | last post by:
My ISP provides a web based email client, but it is not brandable and the features are not that extensive. I'd like to build my own. Has anyone done this, or is anyone aware of any tools out there...
8
by: JayB | last post by:
We sent out an email today to a list of subscribers from our database using ASP and CDO. For some reason, many people received it twice, including myself. I checked the database and there were do...
88
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
117
by: Steevo | last post by:
Any suggestions as to the best programs for cloaking email addresses? Many thanks -- Steevo
9
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5,...
3
by: Frank | last post by:
I am attempting to develop a solution where I handle bounced e-mails. I wish to field all bounced emails in a custom email account such a bounced@mycompany.com From the aricle at...
9
by: Mahernoz | last post by:
Can i send an email from JavaScript? Is it possible? If yes please the code to send email using javascript...
4
Frinavale
by: Frinavale | last post by:
Introduction Many .NET applications will require an email be sent out for various reasons. This article will give a quick examples on how to send an email using VB.NET. The examples given can...
3
by: anu b | last post by:
Hii I am using System.net.mail for sending email... i need to send a webpage with its html content as my email body .....for that i used mail.Isbodyhtml as true...but it is not working for me...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.