473,656 Members | 2,983 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 1706
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.Mai l 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******** ******@TK2MSFTN GP04.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.Ma il 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******** *****@TK2MSFTNG P06.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******** ******@TK2MSFTN GP04.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
automaticall y 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.co m). 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.Exi t, 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******** ******@TK2MSFTN GP03.phx.gbl...
>
"Cor Ligthert [MVP]" <no************ @planet.nlwrote in message
news:Oc******** *****@TK2MSFTNG P06.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******* *******@TK2MSFT NGP04.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*********** ***@TK2MSFTNGP0 2.phx.gbl...
I have just written a utility (with help from this forum) to
automatical ly 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
identifie d 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.co m). 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.Exi t, 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.co m). 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.Exi t, 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@sni pped.invalid", "ad@snipped.inv alid", "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 authenticationl ess 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@sni pped.invalid", "ad@snipped.inv alid", "Test", "Test")
Dec 22 '06 #7
The code is brief,
Imports System.Web.Mail
and in the Form1_Load
SmtpMail.Send(" my*******@comca st.net", strAddressList, strSubject,
strEmailMsg)

where strAddressList is in the form aname <us******@xyc.c om>;
anothername <us******@abc.c om>
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.n et) 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 authenticationl ess 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(sSMT P_Server, iSMTP_Port)
SMTPClient.Cred entials = New Net.NetworkCred ential(sAccName , sAccPW)
Dim SMTPMessage As New MailMessage(sEm ailFROM, sEmailTo, sEmailSubject,
sEmailMessageBo dy)
If Not String.IsNullOr Empty(sFileAtta chment) Then
Dim EmailAttachment As New Attachment(sFil eAttachment)
SMTPMessage.Att achments.Add(Em ailAttachment)
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 authenticationl ess 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(sSMT P_Server, iSMTP_Port)
SMTPClient.Cred entials = New Net.NetworkCred ential(sAccName , sAccPW)
Dim SMTPMessage As New MailMessage(sEm ailFROM, sEmailTo, sEmailSubject,
sEmailMessageBo dy)
If Not String.IsNullOr Empty(sFileAtta chment) Then
Dim EmailAttachment As New Attachment(sFil eAttachment)
SMTPMessage.Att achments.Add(Em ailAttachment)
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

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

Similar topics

3
7041
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. Obviuosly, the file is fine on the server, so the attachment code I am using must be corrupting it, but I dont know what it is: // send email with attachment function emailAttachment($to, $subject, $message, $name, $email,
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 import mimetypes import os,string
3
6820
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 (non-MyDomain.com address) I get the following error: The server rejected one or more recipient addresses. The server response was: 550 You must check your mail from this IP or SMTP Auth before sending to BSmith@Juno.com Here's the FULL...
3
3610
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 smtpMail.Send("from@here.com", to@there.com, "Message subject", "Message Body") I'm sending it to my own email address on a different server using a dummy
1
8175
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 the members of my organization. I think my problem is incorrectly setting the settings on my server or an authentication problem. Here is the code I have written to send a test message: -----Code Begins: Sensitive Information Replaced by -----...
2
12168
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, error is thrown at the .send point. Error is: The following error occured Sending an email: System.ApplicationException: An error occurred sending an email To helen@HerMail.com From ade@MyMail.com Cc Subject A test with Finlistener #1. The body...
9
3453
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 oSMTP.Send(oMailMessage) (in this line I am getting the above err)
7
3331
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 guests added. form.php function createGuestNameAndEmailElements() {
10
5075
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> <zone>BOXING</zone> <status>Running</status> <job>1000139233</job>
31
12674
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 is working for normal email servers, but NOT with gmail server, I am very puzzled still!!) Codes(item c below) It keeps complaining and logs and codes are below. a) apache access logs --------------------------------- 127.0.0.1 - - "GET...
0
8296
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8710
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8497
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8598
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7310
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1928
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.