Click here to Skip to main content
15,882,114 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Outlook Mail send using ASP.NET
Outlook Mail send using ASP.NET
Outlook Mail send using ASP.NET
Outlook Mail send using ASP.NET
Outlook Mail send using ASP.NET
Posted
Updated 16-Mar-11 0:19am
v2
Comments
Wild-Programmer 16-Mar-11 6:20am    
What did you try
What did you try
What did you try
What did you try
What did you try
Dylan Morley 16-Mar-11 6:24am    
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
Sandeep Mewara 16-Mar-11 8:09am    
My vote of 1: For spamming!

Why try to use Outlook? It will only work if you have Outlook installed on the server.
Instead, try this: Sending an Email in C# with or without attachments: generic routine.[^]
 
Share this answer
 
VB
Public Sub SendOutlookMail(Subject As String, Recipient As _
String, Message As String)

On Error GoTo errorHandler
Dim oLapp As Object
Dim oItem As Object

Set oLapp = CreateObject("Outlook.application")
Set oItem = oLapp.createitem(0)
'
With oItem
   .Subject = Subject
   .To = Recipient
   .body = Message
   .Send
End With
'
Set oLapp = Nothing
Set oItem = Nothing
'

Exit Sub

errorHandler:
Set oLapp = Nothing
Set oItem = Nothing
Exit Sub
End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900