473,499 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send email throught VB.NET 2005

April 12, 2006

Hi all

I want to send an email through a VB.Net 2005 application. Can someone show
me some examples:

1. To send an email through the current default email client, Outlook
Express or Microsoft Office Outlook.
2. Can you determine which is the default client in the application.
3. Send an email that does not use any default email client.

Thank you.
Apr 12 '06 #1
2 5884
Here is a class doing the job connecting directly to the mailserver,
not by me. Found it somewhere on the web

So this uses no defoult client

* add the System.Web.Dll reference to your .Net
'* project if doing a Windows Application. An
'* ASP.Net app should include this reference.
'* Simply declare an object of type SendMail in code, ie another class
like a form class,
'* set the body and subject properties, then call
'* MailMessage to send the email
Imports System.Web.Mail

Public Class SendMail
Private _Subject As String
Private _Body As String
Private _Attachment As String
Private _Adress As String
Public Property Adress() As String
Get
Return _Adress
End Get
Set(ByVal Value As String)
_Adress = Value
End Set
End Property
Public Property Subject() As String
Get
Return _Subject
End Get
Set(ByVal Value As String)
_Subject = Value
End Set
End Property
Public Property Body() As String
Get
Return _Body
End Get
Set(ByVal Value As String)
_Body = Value
End Set
End Property
Public Property Attachment() As String
Get
Return _Attachment
End Get
Set(ByVal Value As String)
_Attachment = Value
End Set
End Property
Public Sub MailMessage()
Dim objMail As New MailMessage
'Dim attach As New MailAttachment(_Attachment)
SmtpMail.SmtpServer = "000.00.00" 'this needs to be the Smtp
mail server, a proxy will not work, get this from your administrator,
or Exchange server name in outlook
objMail.From = "sender@home"
objMail.To = _Adress
objMail.Subject = _Subject 'Subject text
objMail.Body = _Body 'Body Text
objMail.BodyFormat = MailFormat.Text 'Html 'can be text also
SmtpMail.Send(objMail)
End Sub
End Class

Apr 12 '06 #2
I'm trying to figure out the same. So far, I think these links might
prove helpful:

http://www.c-sharpcorner.com/Interne...hOutlookCB.asp
http://www.systemnetmail.com/default.aspx
http://www.codeproject.com/csharp/simplemapidotnet.asp

Mike TI wrote:
April 12, 2006

Hi all

I want to send an email through a VB.Net 2005 application. Can someone show
me some examples:

1. To send an email through the current default email client, Outlook
Express or Microsoft Office Outlook.
2. Can you determine which is the default client in the application.
3. Send an email that does not use any default email client.

Thank you.

Apr 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
9410
by: jas | last post by:
I have a basic client/server socket situation setup....where the server accepts a connection and then waits for commands. On the client side, I create a socket, connect to the server...then I...
3
1687
by: lkrubner | last post by:
Hi. I'm messing around with some stuff in an .htaccess file. Among other things, I'd like to send my html files to the PHP parser. I'd also like to rewrite the urls using Apache mod_rewrite, so...
4
2514
by: Colin Kingston | last post by:
Hi For a college project I intend to produce a web based access database which will allow a group leader to send the same email to group members registered for that group. I want the group...
1
5937
by: Nguyen Thanh Danh | last post by:
I'm a student, i try search on Internet but i can't find any sample how to send file throught socket, between 2 computer! Please help me! Thanks!
6
3944
by: JIM.H. | last post by:
Hello, I am using SmtpMail.Send() and I get the following message The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for myMail@hotmail.com...
4
7277
by: roni | last post by:
i dont like to use ocx controlx. is there new dll for vb.net that do the job ? or newer code, to send email throught outlook express.
0
1086
by: Sylvain Devidal | last post by:
Hello, I'm designing a web application that must be able to connect different databases. So I decided to use OleDb connector instead of SqlClient. While with SqlClient, I can run queries like...
3
9727
by: =?Utf-8?B?SHVnaA==?= | last post by:
Hi There, I use follow code to send email inside VB.NET 2005. It does not work well. Error message of "Failure sending email" would occue. However, email was sent out sometimes. I am confused...
4
4241
by: Tony M | last post by:
VS 2005 - XP media - VB .net - winforms - .net 2.0 Just trying to send an email, here is the code and the error message that I get. I can't figure out how to fix it?
0
7014
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7229
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7395
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5485
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4921
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3108
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
311
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.