Click here to Skip to main content
13,803,704 members
Rate this:
Please Sign up or sign in to vote.
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?
Posted 27-Feb-12 22:06pm
Updated 28-Feb-12 0:10am
digimanus 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?
digimanus 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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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

<![CDATA[<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Gmail.aspx.vb" Inherits="Gmail" %>]]>

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.181215.1 | Last Updated 4 Jul 2014
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100