473,890 Members | 1,364 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1633
..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*****@discus sions.microsoft .com> wrote in message
news:BE******** *************** ***********@mic rosoft.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.IsNullOr Empty(Customer. EMail) And _
Not String.IsNullOr Empty(Site.EMai lServer) And _
Not String.IsNullOr Empty(Site.EMai lServerConfirma tionAddy) Then

Dim Phone As New MyCompany.Utili ties.Conversion
Dim OS As New MyCompany.Utili ties.OperatingS ystem

Dim smtpMailClient As New System.Net.Mail .SmtpClient
Dim SiteConfirmEMai l = New
System.Net.Mail .MailAddress(Si te.EMailServerC onfirmationAddy , Site.SiteName)
Dim CustomerEMail = New
System.Net.Mail .MailAddress(Cu stomer.EMail, Customer.FirstN ame & " " &
Customer.LastNa me)
Dim SiteEMail = New
System.Net.Mail .MailAddress(Si te.FacilityEMai l, Site.SiteName)
Dim BccEMail = New System.Net.Mail .MailAddress(OS .Get_EMailBcc,
"")

Dim ConfirmationMes sage As New System.Net.Mail .MailMessage
With ConfirmationMes sage

.From = SiteConfirmEMai l
.To.Add(Custome rEMail)
.Bcc.Add(BccEMa il)
.CC.Add(SiteEMa il)

.Subject = Site.SiteName & " Confirmation"
.IsBodyHtml = True
.Priority = System.Net.Mail .MailPriority.N ormal
.Body = Build_Letter_HT ML(Customer, Site)

End With

Try

With smtpMailClient

.Host = Site.EMailServe r
.DeliveryMethod = SmtpDeliveryMet hod.Network

If Site.EMailServe rAuthentication Then
.Credentials = New
System.Net.Netw orkCredential(S ite.EMailServer AuthUserID,
Site.EMailServe rAuthPassword)
End If

.Send(Confirmat ionMessage)

End With

Catch exSMTP As SmtpException

lb_WelcomeCusto mer.Text =
Build_MailServe rDown_HTML(Cust omer, Site)

Catch ex As Exception

lb_WelcomeCusto mer.Text =
Build_Confirmat ionDown_HTML(Cu stomer, Site)

End Try

Else

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

End If
"herbert" <he*****@discus sions.microsoft .com> wrote in message
news:22******** *************** ***********@mic rosoft.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*****@discus sions.microsoft .com> wrote in message
news:BE******** *************** ***********@mic rosoft.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
3328
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. <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function isPPC() { if (navigator.appVersion.indexOf("PPC") != -1) return true; else return false;
6
11202
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 will include the code I originally used. I understand I should switch from CDONTS to CDO mail but after several sttempts I am finding a very hard time getting the new CDO mail to work properly. Any assistance with this would be greatly...
6
3269
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 my customers are not really happy with having the IIS installed, not being used except to send e-mail this is becoming a problem. I have also tried using a little program from code project for sending e-mail which works great on older servers...
1
2707
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 e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect. I think it is a relay issue. Our system administrator will not allow relaying. In the ASP.Net web.config file I let the web application...
3
9262
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 e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect. I think it is a relay issue. Our system administrator will not allow relaying. In the ASP.Net web.config file I let the web application...
3
3046
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 identifies itself as the computer name which is not in domain.com format, triggering spam filter problems). Instead, I want to have my code send through an SMTP server of a company that we pay for mail service. But they require a username and password....
3
4563
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 windows application it worked fine, however I need to use a service as I don't want to rely on a user being logged in. The errors I get are: Index #:System.Web.HttpException: Could not access 'CDO.Message' object. --->...
14
9154
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 local default SMTP Server and my from address is a valid Yahoo/Hotmail address. I have configures the local SMTP Server to allow the IP Address 127.0.0.1.
15
8602
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 Explorer? I want the user to click a button and it lunch the users default email client and put the contents of a multi line text box in the body of the message and the contents of another text box in the title box and be sitting there read for...
4
7691
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. But sometimes even when I'm just sending one e-mail the web page takes a minutes or so to post. Can anyone tell me why it is so slow, or how to fix the problem? To address this I am thinking of just creating a queue table to write the emails...
0
9978
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9819
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,...
1
10918
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
10460
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
9625
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 projectplanning, coding, testing, and deploymentwithout 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...
0
7169
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6041
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4674
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3275
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.