473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

send mail in .NET 2.0

sendmail in .NET 2.0 is as useless as it was in .NET 1.x
I can't find out how to make it work. Not to mention how to write a setup
project that tests/installs its requirements correctly.

the difference to previous version is that .NET 1.x gave no error message at
all and .NET 2.0 gives useless error message when sendmail fails.

why is Microsoft not able to ship a sendmail class that works out of the box
at least with their own hotmail.com infrastructure?
and which does not need access to windows services configuration which
students don't have?

Or buy one of the companies that offer send mail + receive mail and ship
this as part of .Net 2.0 bugfix release.

over and out. herbert
Feb 14 '06 #1
4 1598
..NET 2.0 mail is much better than .NET 1.1 -- it is structured differently
so if you port to 2.0 you'll need to change a few things, but it works well
with secure severs now at least, don't know if it still has the >1024
character problem (aka you need to insert crlf in body text to prevent the
bizarre symbols that may appear).

I believe you have to go a couple of levels deep to get the exact error, but
the error is there. Keep in mind it can only return what the EMail server
reports to it.
"herbert" <he*****@discussions.microsoft.com> wrote in message
news:BE**********************************@microsof t.com...
sendmail in .NET 2.0 is as useless as it was in .NET 1.x
I can't find out how to make it work. Not to mention how to write a setup
project that tests/installs its requirements correctly.

the difference to previous version is that .NET 1.x gave no error message
at
all and .NET 2.0 gives useless error message when sendmail fails.

why is Microsoft not able to ship a sendmail class that works out of the
box
at least with their own hotmail.com infrastructure?
and which does not need access to windows services configuration which
students don't have?

Or buy one of the companies that offer send mail + receive mail and ship
this as part of .Net 2.0 bugfix release.

over and out. herbert

Feb 14 '06 #2
Rob,

Can you make any of the samples (from VS online help, MSDN or related web
sites) work without deep knowledge of the computer your code executes???

In other words: mabye the smtpclient class in .NET 2.0 is better structured,
however its description is useless for novice to medium programmers (ie those
without sysadmin experience and access rights).

And even if you succeed, there is still no way to create a setup project
with reasonable effort that can do what you do.

Let's ask Microsoft to prove it: please give us a complete VS.2005 project
to download that sends eMail and includes an installer project.

herbert
Feb 14 '06 #3
Hope you can get thru my VB.NET code -- this is implemented from one of my
web applications.

Imports System.Net.Mail

' Customer and Site are my classes
' MyCompany -- well that is obvious ;)

' Validate Customer EMail address, Site EMail Server, Site EMail
Confirmation address have been provided
If Not String.IsNullOrEmpty(Customer.EMail) And _
Not String.IsNullOrEmpty(Site.EMailServer) And _
Not String.IsNullOrEmpty(Site.EMailServerConfirmationA ddy) Then

Dim Phone As New MyCompany.Utilities.Conversion
Dim OS As New MyCompany.Utilities.OperatingSystem

Dim smtpMailClient As New System.Net.Mail.SmtpClient
Dim SiteConfirmEMail = New
System.Net.Mail.MailAddress(Site.EMailServerConfir mationAddy, Site.SiteName)
Dim CustomerEMail = New
System.Net.Mail.MailAddress(Customer.EMail, Customer.FirstName & " " &
Customer.LastName)
Dim SiteEMail = New
System.Net.Mail.MailAddress(Site.FacilityEMail, Site.SiteName)
Dim BccEMail = New System.Net.Mail.MailAddress(OS.Get_EMailBcc,
"")

Dim ConfirmationMessage As New System.Net.Mail.MailMessage
With ConfirmationMessage

.From = SiteConfirmEMail
.To.Add(CustomerEMail)
.Bcc.Add(BccEMail)
.CC.Add(SiteEMail)

.Subject = Site.SiteName & " Confirmation"
.IsBodyHtml = True
.Priority = System.Net.Mail.MailPriority.Normal
.Body = Build_Letter_HTML(Customer, Site)

End With

Try

With smtpMailClient

.Host = Site.EMailServer
.DeliveryMethod = SmtpDeliveryMethod.Network

If Site.EMailServerAuthentication Then
.Credentials = New
System.Net.NetworkCredential(Site.EMailServerAuthU serID,
Site.EMailServerAuthPassword)
End If

.Send(ConfirmationMessage)

End With

Catch exSMTP As SmtpException

lb_WelcomeCustomer.Text =
Build_MailServerDown_HTML(Customer, Site)

Catch ex As Exception

lb_WelcomeCustomer.Text =
Build_ConfirmationDown_HTML(Customer, Site)

End Try

Else

lb_WelcomeCustomer.Text = "Invalid E-mail account or E-Mail
server not configured correctly."

End If
"herbert" <he*****@discussions.microsoft.com> wrote in message
news:22**********************************@microsof t.com...
Rob,

Can you make any of the samples (from VS online help, MSDN or related web
sites) work without deep knowledge of the computer your code executes???

In other words: mabye the smtpclient class in .NET 2.0 is better
structured,
however its description is useless for novice to medium programmers (ie
those
without sysadmin experience and access rights).

And even if you succeed, there is still no way to create a setup project
with reasonable effort that can do what you do.

Let's ask Microsoft to prove it: please give us a complete VS.2005 project
to download that sends eMail and includes an installer project.

herbert

Feb 15 '06 #4
Unless you have configured IIS to use SMTP properly, nothing will make the
System.Net.Mail stuff work properly.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"herbert" <he*****@discussions.microsoft.com> wrote in message
news:BE**********************************@microsof t.com...
sendmail in .NET 2.0 is as useless as it was in .NET 1.x
I can't find out how to make it work. Not to mention how to write a setup
project that tests/installs its requirements correctly.

the difference to previous version is that .NET 1.x gave no error message
at
all and .NET 2.0 gives useless error message when sendmail fails.

why is Microsoft not able to ship a sendmail class that works out of the
box
at least with their own hotmail.com infrastructure?
and which does not need access to windows services configuration which
students don't have?

Or buy one of the companies that offer send mail + receive mail and ship
this as part of .Net 2.0 bugfix release.

over and out. herbert

Feb 17 '06 #5

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

Similar topics

15
by: Steve Horrillo | last post by:
I can't figure out why this script won't insert the subject in the email and why can't I control the font and size being used? I'm not sure where to post this. Let me know where if this is OT. ...
6
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I...
6
by: John J. Hughes II | last post by:
I have a service that needs to send e-mail alerts. I have been attempting to use the System.Net.Mail function from .NET but this seems to require the IIS be installed and running. Since some of...
1
by: Jens Øster | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
3
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
3
by: RN | last post by:
I am tired of sending mail from the built-in SMTP service for so many reasons (errors are nondescriptive in the event log, it doesn't let me control which IP address it sends from, and it...
3
by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a...
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
15
by: cj | last post by:
How can I get a button in VB to send the contents of a text box via email in a manner similar to the "Send To\Mail Recipient" functionality that you can select via right clicking a file in Windows...
4
by: =?Utf-8?B?dHBhcmtzNjk=?= | last post by:
I have a web page that at the click of a button must send a bunch (1000+) emails. Each email is sent individually. I have the code working fine, using Mail Message classes and smtp and all that. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.