I am converting one of my ASP.NET 1.1 apps over to 2.0 and I see that the
old way of sending mail will still work, but I want to make it clean and
convert over to the new way of doing things. You used to be able to specify
CC and BCC recipients and now I can't figure out how to specify these.
I am using the following when converting:
Dim MailObj as New System.Net.Mail.SmtpClient
MailObj.Host = "myhost"
MailObj.Send(From.Text, To.Text, Subj.Text, Msg.Text)
So how do I specify CC and BCC for this?
Thanks in advance! 5 1313
You still need to use MailMessage if you want to add CC and BCC recipients.
The Send method also works with a MailMessage object.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."
"David Hearn" <da*********@stagparkway.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl... I am converting one of my ASP.NET 1.1 apps over to 2.0 and I see that the old way of sending mail will still work, but I want to make it clean and convert over to the new way of doing things. You used to be able to specify CC and BCC recipients and now I can't figure out how to specify these.
I am using the following when converting:
Dim MailObj as New System.Net.Mail.SmtpClient MailObj.Host = "myhost" MailObj.Send(From.Text, To.Text, Subj.Text, Msg.Text)
So how do I specify CC and BCC for this?
Thanks in advance!
Thanks Christopher!
"Christopher Reed" <ca****@nospam.nospam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl... You still need to use MailMessage if you want to add CC and BCC recipients. The Send method also works with a MailMessage object. -- Christopher A. Reed "The oxen are slow, but the earth is patient."
"David Hearn" <da*********@stagparkway.com> wrote in message news:%2***************@TK2MSFTNGP09.phx.gbl...I am converting one of my ASP.NET 1.1 apps over to 2.0 and I see that the old way of sending mail will still work, but I want to make it clean and convert over to the new way of doing things. You used to be able to specify CC and BCC recipients and now I can't figure out how to specify these.
I am using the following when converting:
Dim MailObj as New System.Net.Mail.SmtpClient MailObj.Host = "myhost" MailObj.Send(From.Text, To.Text, Subj.Text, Msg.Text)
So how do I specify CC and BCC for this?
Thanks in advance!
See : http://weblogs.asp.net/scottgu/archi...10/432854.aspx
Although Scott's article doesn't mention BCC, its usage is identical to CC.
See : http://66.129.71.130/QuickStartv20/u...ystem.Net.Mail
for the classes available in System.Net.Mail
and http://66.129.71.130/QuickStartv20/u...ss=MailMessage
For the methods available in System.Net.Mail.MailMessage
Juan T. Llibre
ASP.NET MVP
============
"David Hearn" <da*********@stagparkway.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl... I am converting one of my ASP.NET 1.1 apps over to 2.0 and I see that the old way of sending mail will still work, but I want to make it clean and convert over to the new way of doing things. You used to be able to specify CC and BCC recipients and now I can't figure out how to specify these.
I am using the following when converting:
Dim MailObj as New System.Net.Mail.SmtpClient MailObj.Host = "myhost" MailObj.Send(From.Text, To.Text, Subj.Text, Msg.Text)
So how do I specify CC and BCC for this?
Thanks in advance!
Hi David,
you may try something like this -
MailMessage msg = new MailMessage();
SmtpClient server = new SmtpClient();
msg.From = new MailAddress("xy*@xyz.com", "DisplayName");
msg.To.Add("xy*@xyz.com");
msg.CC.Add("xy*@xyz.com, ab*@xyz.com");
msg.Bcc.Add("xy*@xyz.com, ab*@xyz.com, cd*@de.ca");
msg.Subject = "Subject";
msg.Body = "Message Body";
msg.IsBodyHtml = true;
server.Host = "mailserver";
server.UseDefaultCredentials = true;
server.Send(msg);
HTH.
Kaustav Neogy.
"David Hearn" wrote: I am converting one of my ASP.NET 1.1 apps over to 2.0 and I see that the old way of sending mail will still work, but I want to make it clean and convert over to the new way of doing things. You used to be able to specify CC and BCC recipients and now I can't figure out how to specify these.
I am using the following when converting:
Dim MailObj as New System.Net.Mail.SmtpClient MailObj.Host = "myhost" MailObj.Send(From.Text, To.Text, Subj.Text, Msg.Text)
So how do I specify CC and BCC for this?
Thanks in advance!
"David Hearn" <da*********@stagparkway.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl... I am converting one of my ASP.NET 1.1 apps over to 2.0 and I see that the old way of sending mail will still work, but I want to make it clean and convert over to the new way of doing things. You used to be able to specify CC and BCC recipients and now I can't figure out how to specify these.
I am using the following when converting:
Dim MailObj as New System.Net.Mail.SmtpClient MailObj.Host = "myhost" MailObj.Send(From.Text, To.Text, Subj.Text, Msg.Text)
So how do I specify CC and BCC for this?
Thanks in advance! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rick |
last post by:
Is there a way to use these two types of coding in the Mail function of PHP?
Thanks for any help you can give it is most appreciated!!
money_format('%i', $total)
and
print " <tr...
|
by: Ammar |
last post by:
OK guys,
Thanks to your help, I could finally send ASP mails with attachements...
A very strange question:
When I looked through all the sites you gave me and through Google, I got
the impression...
|
by: Fabricio Sperandio |
last post by:
Hi everyone,
I am using the Mail Class to send an E-mail. It works very well but I would
like show my name instead of the E-mail on the mail client, when the user
receives the E-mail.
Now I...
|
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...
|
by: Bob |
last post by:
In 2003 you could use system.web.mail to send e-mails as long as IIS server
was installed on the computer, you would be able to send e-mail fairly
easily. Since this has been made obsolete and MS...
|
by: shror |
last post by:
hi every body,
i have a problem which is when i was checking my mail() form it work
fine but the problem is that the form configuration is not set
correctly, in details:
the from var is not...
|
by: Dudely |
last post by:
I'm trying to debug someone else's third party code that I'm trying to
install on my site. It works for him on his site, but not for me on
"my" site.
I've traced the problem to the mail() call....
|
by: =?Utf-8?B?VGltb3RoeQ==?= |
last post by:
Hi all,
who can help me , recently i found a problem from the window mail whic are i
am using my own personal mail account and try to using window mail to log in.
anywhre i can receive some of...
|
by: Jeff |
last post by:
I'm writing my php "form mail" script.
Does mail do any checking for header injection in the "to" and
"subject" parameters? CR and/or LF? It seems to me it easily could and
should, but does it?...
|
by: borisding |
last post by:
Hi there,
Well, I really need help from someone here, and hope that someone will answer my question and solve my problem. I know it's very common question and being asked by many developers:
...
|
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,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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
|
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...
|
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: 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,...
|
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...
|
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,...
|
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...
| |