473,503 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending Email via VB.Net

I have just written a utility (with help from this forum) to
automatically send a sign-up sheet to a dozen tennis friends using
Smtp.Send() from the System.Web.Mail namespace. I question that this
message goes through my ISP's SMTP server (Comcast) since I have not
identified that server or provided a password as required in my set up
of OE or Thunderbird. From what I read it does it's own DNS lookup for
each of the addresses. Is this ok with ISPs?

Ed
Dec 21 '06 #1
13 1692
AFAIK unless you explicitely configured something in your code, it is
likeley it uses the local SMTP server. Do you have a local SMTP server (it
is part of the IIS setup) ?

Patrice
"Ed Bitzer" <ed******@yahoo.coma écrit dans le message de news:
u6**************@TK2MSFTNGP02.phx.gbl...
>I have just written a utility (with help from this forum) to automatically
send a sign-up sheet to a dozen tennis friends using Smtp.Send() from the
System.Web.Mail namespace. I question that this message goes through my
ISP's SMTP server (Comcast) since I have not identified that server or
provided a password as required in my set up of OE or Thunderbird. From
what I read it does it's own DNS lookup for each of the addresses. Is this
ok with ISPs?

Ed

Dec 21 '06 #2
A little addition to Partice message

On professional or Server Windows OS.

By instance not on Me and XP home.

Cor

"Patrice Scribe" <http://www.chez.com/scribe/schreef in bericht
news:OE**************@TK2MSFTNGP04.phx.gbl...
AFAIK unless you explicitely configured something in your code, it is
likeley it uses the local SMTP server. Do you have a local SMTP server (it
is part of the IIS setup) ?

Patrice
"Ed Bitzer" <ed******@yahoo.coma écrit dans le message de news:
u6**************@TK2MSFTNGP02.phx.gbl...
>>I have just written a utility (with help from this forum) to automatically
send a sign-up sheet to a dozen tennis friends using Smtp.Send() from the
System.Web.Mail namespace. I question that this message goes through my
ISP's SMTP server (Comcast) since I have not identified that server or
provided a password as required in my set up of OE or Thunderbird. From
what I read it does it's own DNS lookup for each of the addresses. Is this
ok with ISPs?

Ed


Dec 21 '06 #3

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:Oc*************@TK2MSFTNGP06.phx.gbl...
>A little addition to Partice message

On professional or Server Windows OS.

By instance not on Me and XP home.

Cor

"Patrice Scribe" <http://www.chez.com/scribe/schreef in bericht
news:OE**************@TK2MSFTNGP04.phx.gbl...
>AFAIK unless you explicitely configured something in your code, it
is likeley it uses the local SMTP server. Do you have a local SMTP
server (it is part of the IIS setup) ?

Patrice
"Ed Bitzer" <ed******@yahoo.coma écrit dans le message de news:
u6**************@TK2MSFTNGP02.phx.gbl...
>>>I have just written a utility (with help from this forum) to
automatically send a sign-up sheet to a dozen tennis friends using
Smtp.Send() from the System.Web.Mail namespace. I question that
this message goes through my ISP's SMTP server (Comcast) since I
have not identified that server or provided a password as required
in my set up of OE or Thunderbird. From what I read it does it's
own DNS lookup for each of the addresses. Is this ok with ISPs?

Ed

Cor and Patrice,
I was delinquent in providing full detail. I am running XP-Home and
no IIS. I have provided no username, password or SMTP server
identification (i.e. smtp.comcast.com). Simply state Smtp.Send(my
address, to addresses, subject and message) in the Form load and after
a timer delay to be sure it sends, Application.Exit, and it is working
great. I'll run the exe from a scheduler each week

Ed
Dec 21 '06 #4
Hmmmmm ... Smtp.Send ????

Would be interesting to see your code and relevant portions of your
configuration files.
"Ed Bitzer" <ed******@yahoo.comwrote in message
news:ub**************@TK2MSFTNGP03.phx.gbl...
>
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:Oc*************@TK2MSFTNGP06.phx.gbl...
>>A little addition to Partice message

On professional or Server Windows OS.

By instance not on Me and XP home.

Cor

"Patrice Scribe" <http://www.chez.com/scribe/schreef in bericht
news:OE**************@TK2MSFTNGP04.phx.gbl...
>>AFAIK unless you explicitely configured something in your code, it is
likeley it uses the local SMTP server. Do you have a local SMTP server
(it is part of the IIS setup) ?

Patrice
"Ed Bitzer" <ed******@yahoo.coma écrit dans le message de news:
u6**************@TK2MSFTNGP02.phx.gbl...
I have just written a utility (with help from this forum) to
automatically send a sign-up sheet to a dozen tennis friends using
Smtp.Send() from the System.Web.Mail namespace. I question that this
message goes through my ISP's SMTP server (Comcast) since I have not
identified that server or provided a password as required in my set up
of OE or Thunderbird. From what I read it does it's own DNS lookup for
each of the addresses. Is this ok with ISPs?

Ed


Cor and Patrice,
I was delinquent in providing full detail. I am running XP-Home and no
IIS. I have provided no username, password or SMTP server identification
(i.e. smtp.comcast.com). Simply state Smtp.Send(my address, to addresses,
subject and message) in the Form load and after a timer delay to be sure
it sends, Application.Exit, and it is working great. I'll run the exe
from a scheduler each week

Ed


Dec 22 '06 #5
I am with Stephanie in wanting to see your code.

I have a local IIS server running from a terminal server and send various
emails to clients. With Comcast in particular, I always fail with the local
SMTP server since Comcast bounces the message back saying that it needs to
have a reverse DNS entry available to authenticate the mail source (or
somehting like this message). With a privately addressed SMTP server this
is not possible.

Please let us know how you are doing this.

Rick
Dec 22 '06 #6
On Thu, 21 Dec 2006 17:05:45 -0500, "Ed Bitzer" <ed******@yahoo.comwrote:
Cor and Patrice,
I was delinquent in providing full detail. I am running XP-Home and
no IIS. I have provided no username, password or SMTP server
identification (i.e. smtp.comcast.com). Simply state Smtp.Send(my
address, to addresses, subject and message) in the Form load and after
a timer delay to be sure it sends, Application.Exit, and it is working
great. I'll run the exe from a scheduler each week
I concur with the others: I'd like to see that code.

These two lines in VB.Net:

Dim sx As New SmtpClient
sx.Send("ad@snipped.invalid", "ad@snipped.invalid", "Test", "Test")

cause an exception

"The SMTP host was not specified."

My idea of what that means is that you (or someone) must have specified a
mailserver somewhere, or you'd have run into the same exception.
That doesn't necessary have to be in your code: the SMTP server can also be
specified in the .Net application or machine configuration file.

But now I'm beginning to wonder: it isn't done often AFAIK, but the SMTP
server can also be passed as a DHCP option (option 069) when your PC
receives its IP address. What I don't know is if Windows/.Net CLR would
use it as default if your network admin had set it up that way.

As for username and password, that's another matter: you normally don't
need those to send mail, only to retrieve mail from a POP account.

SMTP is in essence an authenticationless protocol, it will accept mail from
anybody (which is why there's so much spam going around, which in turn is
the reason why they started building in restrictions, but that story is too
long for this message).

This version works (here, for me, if I replace the addresses by real ones):

Dim sx As New SmtpClient
sx.Host = "10.1.0.5"
sx.Send("ad@snipped.invalid", "ad@snipped.invalid", "Test", "Test")
Dec 22 '06 #7
The code is brief,
Imports System.Web.Mail
and in the Form1_Load
SmtpMail.Send("my*******@comcast.net", strAddressList, strSubject,
strEmailMsg)

where strAddressList is in the form aname <us******@xyc.com>;
anothername <us******@abc.com>
strSubject is "my subject"
strEmailMsg is "my message"

I have successfully sent messages to my Comcast addresses, my Yahoo
address and to a Verizon customer.

My ISP is Comcast and I am connected via a router (I have two
computers) to the modem. I am running XP-Home (fully updated) and
VB.Net Framework 1.1 and the Microsoft Visual Basic.NET (Standard)
2003

I obviously am not feeding you guys enough detail so you will have to
ask specifically.

I did catch Lucdvc's point that username and password are only
necessary for receiving mail. I do however in OE specify the SMTP
server (smtp.comcast.net) where I have not done that here.

Ed




Dec 22 '06 #8
Lucvdv wrote:
>
As for username and password, that's another matter: you normally don't
need those to send mail, only to retrieve mail from a POP account.

SMTP is in essence an authenticationless protocol, it will accept mail from
anybody (which is why there's so much spam going around, which in turn is
the reason why they started building in restrictions, but that story is too
long for this message).
In Australia, just about all ISP's are now stopping SMTP without
authenticating first. To this end, the following is typically what I'm
using in my applications -

Dim SMTPClient As New SmtpClient(sSMTP_Server, iSMTP_Port)
SMTPClient.Credentials = New Net.NetworkCredential(sAccName, sAccPW)
Dim SMTPMessage As New MailMessage(sEmailFROM, sEmailTo, sEmailSubject,
sEmailMessageBody)
If Not String.IsNullOrEmpty(sFileAttachment) Then
Dim EmailAttachment As New Attachment(sFileAttachment)
SMTPMessage.Attachments.Add(EmailAttachment)
End If
SMTPClient.Send(SMTPMessage)

Obviously the above code isn't showing error traps etc., but I trust
this helps the OP.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Dec 22 '06 #9
Very much appreciate your sharing code. I have not yet been successful at
sending e-mail with smtp. What are the following parameters?

sSMTP_Server, iSMTP_Port

Also, do you have IIs installed? Not sure if I have to have this installed.
--
Dennis in Houston
"ShaneO" wrote:
Lucvdv wrote:

As for username and password, that's another matter: you normally don't
need those to send mail, only to retrieve mail from a POP account.

SMTP is in essence an authenticationless protocol, it will accept mail from
anybody (which is why there's so much spam going around, which in turn is
the reason why they started building in restrictions, but that story is too
long for this message).
In Australia, just about all ISP's are now stopping SMTP without
authenticating first. To this end, the following is typically what I'm
using in my applications -

Dim SMTPClient As New SmtpClient(sSMTP_Server, iSMTP_Port)
SMTPClient.Credentials = New Net.NetworkCredential(sAccName, sAccPW)
Dim SMTPMessage As New MailMessage(sEmailFROM, sEmailTo, sEmailSubject,
sEmailMessageBody)
If Not String.IsNullOrEmpty(sFileAttachment) Then
Dim EmailAttachment As New Attachment(sFileAttachment)
SMTPMessage.Attachments.Add(EmailAttachment)
End If
SMTPClient.Send(SMTPMessage)

Obviously the above code isn't showing error traps etc., but I trust
this helps the OP.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Dec 23 '06 #10
Dennis and Shane

"Dennis" <De****@discussions.microsoft.comwrote in message
news:1C**********************************@microsof t.com...
Very much appreciate your sharing code. I have not yet been
successful at
sending e-mail with smtp. What are the following parameters?

sSMTP_Server, iSMTP_Port

Also, do you have IIs installed? Not sure if I have to have this
installed.
--
Dennis in Houston
The SMTPClient requires version 2.0, not the 1.1 that I am running.
Using my simple code I have had no problems but suspect as Shane
indicates Comcast will catch up and require "authentication." I am
about to purchase 2.0 just to get prepared.

Ed
Dec 24 '06 #11
Dennis wrote:
Very much appreciate your sharing code. I have not yet been successful at
sending e-mail with smtp. What are the following parameters?

sSMTP_Server, iSMTP_Port

Also, do you have IIs installed? Not sure if I have to have this installed.
The first parameter is for your ISP's SMTP Server name/address, usually
something like "mail.yourISPname.com", or if you have your own SMTP
Server on your network, it can be something like "192.168.1.1".

The iSMTP_Port is the port number used to transfer the message. This is
usually 25.

No, you won't need IIS installed but you do need to ensure you have -

Imports System.Net.Mail

at the top of your application.
ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Dec 25 '06 #12
Thanks. Are there any References that I need to add to the project. Note
that I am using VB.Net 2003 so will probably need the IIs installed.
--
Dennis in Houston
"ShaneO" wrote:
Dennis wrote:
Very much appreciate your sharing code. I have not yet been successful at
sending e-mail with smtp. What are the following parameters?

sSMTP_Server, iSMTP_Port

Also, do you have IIs installed? Not sure if I have to have this installed.

The first parameter is for your ISP's SMTP Server name/address, usually
something like "mail.yourISPname.com", or if you have your own SMTP
Server on your network, it can be something like "192.168.1.1".

The iSMTP_Port is the port number used to transfer the message. This is
usually 25.

No, you won't need IIS installed but you do need to ensure you have -

Imports System.Net.Mail

at the top of your application.
ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Dec 25 '06 #13
Dennis wrote:
Thanks. Are there any References that I need to add to the project. Note
that I am using VB.Net 2003 so will probably need the IIs installed.
You shouldn't need any other References, however I'm using VB.NET 2005
so I can't be sure about 2003. Give it a try and post back if it
doesn't work, maybe another 2003 user could help, if needed.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Dec 25 '06 #14

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

Similar topics

3
7027
by: Paul Lamonby | last post by:
Hi, I am sending a file from the server as an email attachment. The file is being attached no problem and sending the email, but I get an error when I try to open it saying it is corrupt....
0
522
by: praba kar | last post by:
Dear All, I have doubt regarding mail sending smtplib module. The below code is I used to send a mail. ########################################## import email.Message import email.Utils...
3
6806
by: VB Programmer | last post by:
I have an ASPX page where I send out emails through my mail server mail.MyDomain.com. When I send emails to MyName@MyDomain.com it sends PERFECTLY. When I try sending an email to any other address...
3
3594
by: Ant | last post by:
Hi, I'm using the MailMessage & smtpMail classes in System.Web.Mail to send mail, however it's not sending any emails. I'm using it on a Windows 2003 server. The simplest way to use this is...
1
8154
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
2
12137
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used,...
9
3432
by: JoeP | last post by:
Hi All, How can I find the reason for such an error: Failure sending mail. Some Code... oMailMessage.IsBodyHtml = False oMailMessage.Body = cEmailBody Dim oSMTP As New SmtpClient...
7
3314
by: bleachie | last post by:
Hey, I just need some help, my form seems to not send me all of the 'guestNames' and 'guestEmails' forms. i use this function to add more guestnames and guestemail fields based on the number of...
10
5040
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area>...
31
12607
by: happyse27 | last post by:
Hi All, I am trying for weeks how to send email from windows pc, which from my gmail account to my hotmail account. Using net::smtp module sending email failed,Kindly assist. (for the item d it...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7074
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
7322
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
6982
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
4667
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3161
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
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
374
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.