Click here to Skip to main content
14,975,556 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hey guys.
I need a help on sending email using VB.NET without having installed SMTP server/IIS.
I tried using System.Net.Mail namespace to send Email, but its not working. I get the error :
554,Transaction failed,Sender <> rejected.
I dont want to install SMTP server/IIS. I wonder how this outlook works, I have configured my outlook with my email settings and it works. But not in VB.NET.
Assume I have the settings in Outlook as follows :
Email Addres :
Server Info >
Account Type: POP3
Incoming Mail Server:
Outgoing Mail Server:
Username :
password : 123456

Outlook > More Settings >
Incoming Port(POP3):110
Outgoing Port(SMTP):25

Is there any method to send email using above settings? Also someone please explain me how this outlook works without SMTP?
Updated 27-Feb-12 23:10pm
Herman<T>.Instance 28-Feb-12 3:26am
which security settings your current smrp server uses? Do you use credentails?
tonydsouza1987 28-Feb-12 4:23am
Yes I use credentials. I used Net.NetworkCredential to supply credentials. It doesnt work. Then I came to know that I need to install SMTP. But is it possible to send email without Installing SMTP component?
Herman<T>.Instance 28-Feb-12 5:11am
is the outgoing port 25 or another one?
tonydsouza1987 28-Feb-12 5:49am
Simon_Whale 28-Feb-12 6:19am
Each Email hosting company will require you to send mail through their severs in a particular way, I would suggest that you contact them and find out what they need you to do for it too happen.

As I have done something similar before and one provider required me to use a sercure authsmtp server and another provider requires you to just send it to them with a valid user name a password.

Hey digimanus,
Sorry for bothering you on this. It was my mistake I had given passwd wrong.
I think we dont need SMTP/IIS windows feature installed to work this.
I got it working without SMTP installed.
' > My email ID
'XYZ@( > recepient)
' > Incoming Mail server/Outgoing Mail server as configured in outlook.
Dim emailMsg As New MailMessage("", "", "Subject", "Body")
Dim smtpclnt As New SmtpClient("", 25)
smtpclnt.Credentials = New Net.NetworkCredential("", "123456")
smtpclnt.EnableSsl = True
Catch ex As SmtpException
    Exit Sub
End Try
MessageBox.Show("Email sent succesfully")

Thank you for your conern.
hi..please try this..
Imports System.Net.Mail
Partial Class Gmail
    Inherits System.Web.UI.Page
    Protected Sub Button1_Click1(sender As Object, e As System.EventArgs) Handles Button1.Click
        Dim mail As MailMessage = New MailMessage()
       mail.From = New MailAddress("")
        mail.Subject = "hi"
        mail.Body = TextBox2.Text
        mail.IsBodyHtml = True
        Dim smtp As SmtpClient = New SmtpClient()
        smtp.Host = ""
        smtp.Credentials = New System.Net.NetworkCredential("", "yourpassword")
        smtp.EnableSsl = True
    End Sub
    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
    End Sub
End Class

Member 11129380 29-Jul-20 3:21am
Failure sending mail.
{"Failure sending mail."}

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