multiple email adressees with system.web.mail

G

Guest

Hi

We are using system.web.mail with .Net 1.1 (.Net 2.00 under development) and
some of our users are reporting that having multiple names in the 'to' field
for sending emails (using smtpmail) causes the email not to be sent. Email
server software is Exchange SP2, but other users (including our own test
site) use the same without any problems. The multiple names in the 'to' list
are separated with semicolons.
Unfortunately we don't have the text of any exception that occurs when the
mail is sent, we could add that and install a test version on the customer's
PC but these customers are sensitive and won't take kindly to being used as a
test site.

Any ideas of what could be wrong? I have noticed (in developing the .NET 2
version using System.Net.Mail) that the delimiter needs to be a comma and not
a semicolon. Is there a connection here?
 
N

Nicholas Paldino [.NET/C# MVP]

In .NET 2.0, you should be using the classes in the System.Net.Mail
namespace. The MailMessage class has collections for To, Bcc, and Cc fields
so that you don't have to worry about delimiting these lists yourself.

The documentation for the Bcc, To and Cc properties all state that the
list should be semi-colon delimited.

As a general statement, you should have some sort of exception handling
in your program, so that when fail conditions occur on the customer site,
you can get log information easily for situations like this.

Unfortunately, without the exception information, it is almost
impossible to determine what's going on.

Are you sure that the SmtpServer property on the SmtpMail class is set
properly? Is there anything on the server which prevents sending bulk mail
out in this fashion?
 
G

Guest

Nicholas,

Ok I have now managed to run a small amendment with the exception reported
on the customer's PC . it's the dreaded 'cannot access CDO object...'. But
how can this be when everything works fine with only one name in the list,
and fails with 2 or more?
I have also checked with the user and there's no problem sending to the same
3 'to' adresses from Outlook on the same server.
Another oddity, discovered in testing on this system, is that an email with
the subject
"alarm240413 new (51.35.03) 22.56" also gives the 'CDO' error, while exactly
the same email without the brackets, i.e.
"alarm240413 new 51.35.03 22.56" works just fine. The brackets give no
problem on other email servers.

Nicholas Paldino said:
In .NET 2.0, you should be using the classes in the System.Net.Mail
namespace. The MailMessage class has collections for To, Bcc, and Cc fields
so that you don't have to worry about delimiting these lists yourself.

The documentation for the Bcc, To and Cc properties all state that the
list should be semi-colon delimited.

As a general statement, you should have some sort of exception handling
in your program, so that when fail conditions occur on the customer site,
you can get log information easily for situations like this.

Unfortunately, without the exception information, it is almost
impossible to determine what's going on.

Are you sure that the SmtpServer property on the SmtpMail class is set
properly? Is there anything on the server which prevents sending bulk mail
out in this fashion?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

quilkin said:
Hi

We are using system.web.mail with .Net 1.1 (.Net 2.00 under development)
and
some of our users are reporting that having multiple names in the 'to'
field
for sending emails (using smtpmail) causes the email not to be sent. Email
server software is Exchange SP2, but other users (including our own test
site) use the same without any problems. The multiple names in the 'to'
list
are separated with semicolons.
Unfortunately we don't have the text of any exception that occurs when the
mail is sent, we could add that and install a test version on the
customer's
PC but these customers are sensitive and won't take kindly to being used
as a
test site.

Any ideas of what could be wrong? I have noticed (in developing the .NET 2
version using System.Net.Mail) that the delimiter needs to be a comma and
not
a semicolon. Is there a connection here?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top