473,385 Members | 1,464 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,385 software developers and data experts.

Sending e-mail to a distribution group in asp.net

Hi,

I have an asp.net (vb) app where I am creating a Crystal Report,
exporting it to a .pdf file and then e-mailing that report, as an
attachment, to several users using System.Web.Mail.MailMessage(). One
of the properties is MailMessage.To which is my recipient list. All
is working well.

However, when I substitute individual email addresses in the
MailMessage.To string with the name of a distribution group, it fails
never giving an error.

Has anyone run across this before?

Thanks,
Brian
Nov 18 '05 #1
5 12030
Hi Brian,
Thanks for posting in the community!
From your description, you used the "System.Web.Mail.MailMessage" buildin
components to send mail. This works well when you set the MailMessage's
"To" address as individual address( the xx@xx.xx format?). However, you
found it didn't work if you use some certain distribute group's name as the
address to send the mail ,yes?
If there is anything I misunderstood, please feel free to let me know.

As for this problem, is the "group name" string you mentioned just the
certain group's alias? For example a certain newgroup or some other groups
such as Yahoo group?
If so, I think the alias (a friendly name) didn't work because each email
be sent need a specifyed "To" address, which need to be a valid address
which is formated as "xx@xx.xx". The alias for friendly name is just used
to help user to remember it. And the mapping between the alias and their
actual address are usually done by some Mail client tools such as outlook
or some other web access tools.
So we need to specify the actual name of the group to the "To" member of
the MailMessage if we want to send a mail to that group.
And here is a FAQ list on the "System.Web.Mail" components,
#System.Web.Mail FAQ
http://systemwebmail.com/faq.aspx

There are detailed description on how to define friendly name(alias) for
MailMessage's "From" or "To" field:
#2.4 How do I change the FROM address to a friendly name?
http://systemwebmail.com/faq/2.4.aspx

#2.5 How do I change the TO address to a friendly name?
http://systemwebmail.com/faq/2.5.aspx

Please check out the above items. If you have anything unclear, please feel
free to post here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #2
Hi Steven,

Thank you for your reply and I apologize for being vague. The group
name I was refering to was indeed an Outlook mail group or distribution
list.

In my app, this works and both Bill and Joe get the message.

MailMessage.To = “Bi**@abc.com; Jo*@abc.com
However, my recipient list is not static and instead I would like to
send to an Outlook mail group.

For example, I have a group called TestGroup that has an SMTP address of
“Te*******@abc.com” And TestGroup has 2 members; Bi**@abc.com and
Jo*@abc.com .

I am trying to get this to work:

MailMessage.To = “Te*******@abc.com”
I am trying to avoid maintaining email addresses in an asp.net
application especially since they are already maintained in mail groups
in Outlook.
Thanks again,
Brian
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3
Hi Brian,
Thanks for your followup. Based on your further reply, you're able to send
the mail using the detailed reciever list such as
"af**@aa.com;bb*@bb.com;cc*@cc.com..." but not able to via their group's
smtp address?
I've also done a test on my side. I send the mail via the following code

System.Web.Mail.MailMessage msg = new System.Web.Mail.MailMessage();
msg.From= "myemailaddress";
msg.To = txtSmtpAddress.Text;
msg.Subject = "Hello, just a test.";
msg.Body = "Sorry for disturbing you!";
System.Web.Mail.SmtpMail.SmtpServer = "smarthost";
System.Web.Mail.SmtpMail.Send( msg );

I used a local group in our Active Dirctory for test. It seems that this
works well, I'm able to send to the group via it's smtpaddress.

In addition, have you tryied send to any other groups? Does this problem
occurs every group you send?
I think you can also try using OutLook to do the same test to see whether
the same problem remains. I think there must be something else which cause
the problem. Please check out it and let know if you got any progress.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #4
Hi,

Thanks for working on this and you were right, it was something else on
my end.

My company is in the process of changing domain names, and the group I
set up to test with only used the new domain name. Somewhere in some
remote Exchange Server, it was adding an additional address with the old
domain name in an effort not to route the thing around the country to
send an email four desks away. All along though, though, I was able to
successfully send to this group new group via Outlook and even AOL, so I
thought the group was fine. Next, I used a generic dumping account as
my from address and never saw the undeliverable message that said it was
looking for the old domain address as well as the new. It was not until
I put my address in the from address that I saw the error.
Thanks again and sorry to send you on a goose chase.

Brian
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #5
Hi Brian,
Thanks for your followup. I'm glad that we've figured out the problem. It's
my pleasure work with you. Next time if you meet any problem or need help,
please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #6

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

Similar topics

3
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....
1
by: coder_1024 | last post by:
I'm trying to send a packet of binary data to a UDP server. If I send a text string, it works fine. If I attempt to send binary data, it sends a UDP packet with 0 bytes of data (just the...
3
by: Robert A. van Ginkel | last post by:
Hello Fellow Developer, I use the System.Net.Sockets to send/receive data (no tcpclient/tcplistener), I made a receivethread in my wrapper, the receivethread loops/sleeps while waiting for data...
4
by: yaron | last post by:
Hi, I have a problem when sending data over TCP socket from c# client to java server. the connection established ok, but i can't send data from c# client to java server. it's work ok with...
3
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce...
3
by: Sells, Fred | last post by:
I'm using MSW XP Pro with Python 2.4 to develop but production will be Linux with Python 2.3. (could upgrade to 2.4 if absolutely necessary) I can also switch to Linux for development if...
9
by: Miro | last post by:
VB 2003 at the end of the code, this works great. bytCommand = Encoding.ASCII.GetBytes("testing hello send text") udpClient.Send(bytCommand, bytCommand.Length) and this recieves it Dim...
0
by: remya1000 | last post by:
by using FTP i can send files to server using vb.net. if the file is big, then it will take some time to complete the sending process to server.or if we were sending 3-4 files to the server one by...
10
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>...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.