Showing posts with label multiple. Show all posts
Showing posts with label multiple. Show all posts

Saturday, March 31, 2012

SendMail ASP.NET 2.0: Multiple To's

Hello,
I am trying to send email to 4 people (str01 =
"p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:
Dim addrFrom As New MailAddress(str00)
Dim addrTo As New MailAddress(str01)
My problem is that only the first person receives the email. When I check
the variable addrTo the value is "p1.mysite.com". Any help with this would
be appreciated.
--
Thanks in advance,
sck10A mailAddress is used for a single person, the To property of the
MailMessage is actually a collection...
ur supposed to do:
myMessage.To.Add(new MailAddress("email1'))
myMessage.To.Add(new MailAddress("email2'))
myMessage.To.Add(new MailAddress("email3'))
Karl
http://www.openmymind.net/
http://www.fuelindustries.com/
"sck10" <sck10@.online.nospam> wrote in message
news:eyEDvZOWGHA.4924@.TK2MSFTNGP05.phx.gbl...
> Hello,
> I am trying to send email to 4 people (str01 =
> "p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:
> Dim addrFrom As New MailAddress(str00)
> Dim addrTo As New MailAddress(str01)
> My problem is that only the first person receives the email. When I check
> the variable addrTo the value is "p1.mysite.com". Any help with this
> would
> be appreciated.
> --
> Thanks in advance,
> sck10
>
Mail recipients can also be added using the cc and bcc attributes.
static void MultipleRecipients()
{
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
//to specify a friendly 'from' name, we use a different ctor
mail.From = new MailAddress("me@.company.com", "Me");
//since the To,Cc, and Bcc accept addresses,
//we can use the same technique as the From address
//since the To, Cc, and Bcc properties are collections,
//to add multiple addreses, we simply call .Add(...) multple times
mail.To.Add("you@.yourcompany.com");
mail.To.Add("you2@.yourcompany.com");
mail.CC.Add("cc1@.yourcompany.com");
mail.CC.Add("cc2@.yourcompany.com");
mail.Bcc.Add("blindcc1@.yourcompany.com");
mail.Bcc.Add("blindcc2@.yourcompany.com");
//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";
//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Karl Seguin [MVP]" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net> wro
te in message
news:eN2MefOWGHA.924@.TK2MSFTNGP03.phx.gbl...
>A mailAddress is used for a single person, the To property of the MailMessa
ge is actually a
>collection...
> ur supposed to do:
> myMessage.To.Add(new MailAddress("email1'))
> myMessage.To.Add(new MailAddress("email2'))
> myMessage.To.Add(new MailAddress("email3'))
> Karl
> --
> http://www.openmymind.net/
> http://www.fuelindustries.com/
>
> "sck10" <sck10@.online.nospam> wrote in message news:eyEDvZOWGHA.4924@.TK2MS
FTNGP05.phx.gbl...
>
OT: Can you retrieve your email address from the smtp web.config?
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uFZL2pOWGHA.752@.TK2MSFTNGP02.phx.gbl...
> Mail recipients can also be added using the cc and bcc attributes.
> static void MultipleRecipients()
> {
> //create the mail message
> MailMessage mail = new MailMessage();
> //set the addresses
> //to specify a friendly 'from' name, we use a different ctor
> mail.From = new MailAddress("me@.company.com", "Me");
> //since the To,Cc, and Bcc accept addresses,
> //we can use the same technique as the From address
> //since the To, Cc, and Bcc properties are collections,
> //to add multiple addreses, we simply call .Add(...) multple times
> mail.To.Add("you@.yourcompany.com");
> mail.To.Add("you2@.yourcompany.com");
> mail.CC.Add("cc1@.yourcompany.com");
> mail.CC.Add("cc2@.yourcompany.com");
> mail.Bcc.Add("blindcc1@.yourcompany.com");
> mail.Bcc.Add("blindcc2@.yourcompany.com");
> //set the content
> mail.Subject = "This is an email";
> mail.Body = "this is the body content of the email.";
> //send the message
> SmtpClient smtp = new SmtpClient("127.0.0.1");
> smtp.Send(mail);
> }
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
> ===================================
> "Karl Seguin [MVP]" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME
> net> wrote in message news:eN2MefOWGHA.924@.TK2MSFTNGP03.phx.gbl...
>
Hello, VickZaro.
The pattern to follow is this one :
<myGroup>
<nestedGroup>
<mySection>
<add key="key_one" value="1"/>
<add key="key_two" value="2"/>
</mySection>
</nestedGroup>
</myGroup>
</configuration>
You can read the value of the configuration section defined in the preceding
example as follows:
Dim config As NameValueCollection=ConfigurationSetting
s.GetConfig("myGroup/n
estedGroup/mySection")
Response.Write("The value of key_one is " & Server.HtmlEncode(config("key_on
e")) & "<br>")
Response.Write("The value of key_two is " & Server.HtmlEncode(config("key_tw
o")) )
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"VickZaro" <VickZaro2112@.hotmail.com> wrote in message
news:LzXYf.94692$6Q2.1609125@.weber.videotron.net...
> OT: Can you retrieve your email address from the smtp web.config?
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:uFZL2pOWGHA.752@.TK2MSFTNGP02.phx.gbl...
>

SendMail ASP.NET 2.0: Multiple Tos

Hello,

I am trying to send email to 4 people (str01 =
"p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:

Dim addrFrom As New MailAddress(str00)
Dim addrTo As New MailAddress(str01)

My problem is that only the first person receives the email. When I check
the variable addrTo the value is "p1.mysite.com". Any help with this would
be appreciated.
--
Thanks in advance,

sck10A mailAddress is used for a single person, the To property of the
MailMessage is actually a collection...

ur supposed to do:

myMessage.To.Add(new MailAddress("email1'))
myMessage.To.Add(new MailAddress("email2'))
myMessage.To.Add(new MailAddress("email3'))

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/

"sck10" <sck10@.online.nospam> wrote in message
news:eyEDvZOWGHA.4924@.TK2MSFTNGP05.phx.gbl...
> Hello,
> I am trying to send email to 4 people (str01 =
> "p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:
> Dim addrFrom As New MailAddress(str00)
> Dim addrTo As New MailAddress(str01)
> My problem is that only the first person receives the email. When I check
> the variable addrTo the value is "p1.mysite.com". Any help with this
> would
> be appreciated.
> --
> Thanks in advance,
> sck10
Mail recipients can also be added using the cc and bcc attributes.

static void MultipleRecipients()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
//to specify a friendly 'from' name, we use a different ctor
mail.From = new MailAddress("me@.company.com", "Me");

//since the To,Cc, and Bcc accept addresses,
//we can use the same technique as the From address
//since the To, Cc, and Bcc properties are collections,
//to add multiple addreses, we simply call .Add(...) multple times

mail.To.Add("you@.yourcompany.com");
mail.To.Add("you2@.yourcompany.com");
mail.CC.Add("cc1@.yourcompany.com");
mail.CC.Add("cc2@.yourcompany.com");
mail.Bcc.Add("blindcc1@.yourcompany.com");
mail.Bcc.Add("blindcc2@.yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Karl Seguin [MVP]" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message
news:eN2MefOWGHA.924@.TK2MSFTNGP03.phx.gbl...
>A mailAddress is used for a single person, the To property of the MailMessage is actually a
>collection...
> ur supposed to do:
> myMessage.To.Add(new MailAddress("email1'))
> myMessage.To.Add(new MailAddress("email2'))
> myMessage.To.Add(new MailAddress("email3'))
> Karl
> --
> http://www.openmymind.net/
> http://www.fuelindustries.com/
>
> "sck10" <sck10@.online.nospam> wrote in message news:eyEDvZOWGHA.4924@.TK2MSFTNGP05.phx.gbl...
>> Hello,
>>
>> I am trying to send email to 4 people (str01 =
>> "p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:
>>
>> Dim addrFrom As New MailAddress(str00)
>> Dim addrTo As New MailAddress(str01)
>>
>> My problem is that only the first person receives the email. When I check
>> the variable addrTo the value is "p1.mysite.com". Any help with this would
>> be appreciated.
>> --
>> Thanks in advance,
>>
>> sck10
>>
>>
OT: Can you retrieve your email address from the smtp web.config?

"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uFZL2pOWGHA.752@.TK2MSFTNGP02.phx.gbl...
> Mail recipients can also be added using the cc and bcc attributes.
> static void MultipleRecipients()
> {
> //create the mail message
> MailMessage mail = new MailMessage();
> //set the addresses
> //to specify a friendly 'from' name, we use a different ctor
> mail.From = new MailAddress("me@.company.com", "Me");
> //since the To,Cc, and Bcc accept addresses,
> //we can use the same technique as the From address
> //since the To, Cc, and Bcc properties are collections,
> //to add multiple addreses, we simply call .Add(...) multple times
> mail.To.Add("you@.yourcompany.com");
> mail.To.Add("you2@.yourcompany.com");
> mail.CC.Add("cc1@.yourcompany.com");
> mail.CC.Add("cc2@.yourcompany.com");
> mail.Bcc.Add("blindcc1@.yourcompany.com");
> mail.Bcc.Add("blindcc2@.yourcompany.com");
> //set the content
> mail.Subject = "This is an email";
> mail.Body = "this is the body content of the email.";
> //send the message
> SmtpClient smtp = new SmtpClient("127.0.0.1");
> smtp.Send(mail);
> }
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
> ===================================
> "Karl Seguin [MVP]" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME
> net> wrote in message news:eN2MefOWGHA.924@.TK2MSFTNGP03.phx.gbl...
>>A mailAddress is used for a single person, the To property of the
>>MailMessage is actually a collection...
>>
>> ur supposed to do:
>>
>> myMessage.To.Add(new MailAddress("email1'))
>> myMessage.To.Add(new MailAddress("email2'))
>> myMessage.To.Add(new MailAddress("email3'))
>>
>> Karl
>>
>> --
>> http://www.openmymind.net/
>> http://www.fuelindustries.com/
>>
>>
>> "sck10" <sck10@.online.nospam> wrote in message
>> news:eyEDvZOWGHA.4924@.TK2MSFTNGP05.phx.gbl...
>>> Hello,
>>>
>>> I am trying to send email to 4 people (str01 =
>>> "p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:
>>>
>>> Dim addrFrom As New MailAddress(str00)
>>> Dim addrTo As New MailAddress(str01)
>>>
>>> My problem is that only the first person receives the email. When I
>>> check
>>> the variable addrTo the value is "p1.mysite.com". Any help with this
>>> would
>>> be appreciated.
>>> --
>>> Thanks in advance,
>>>
>>> sck10
>>>
>>>
>>
>>
Hello, VickZaro.

The pattern to follow is this one :

<myGroup>
<nestedGroup>
<mySection>
<add key="key_one" value="1"/>
<add key="key_two" value="2"/>
</mySection>
</nestedGroup>
</myGroup>
</configuration
You can read the value of the configuration section defined in the preceding example as follows:

Dim config As NameValueCollection=ConfigurationSettings.GetConfi g("myGroup/nestedGroup/mySection")
Response.Write("The value of key_one is " & Server.HtmlEncode(config("key_one")) & "<br>")
Response.Write("The value of key_two is " & Server.HtmlEncode(config("key_two")) )

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"VickZaro" <VickZaro2112@.hotmail.com> wrote in message
news:LzXYf.94692$6Q2.1609125@.weber.videotron.net.. .
> OT: Can you retrieve your email address from the smtp web.config?
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:uFZL2pOWGHA.752@.TK2MSFTNGP02.phx.gbl...
>> Mail recipients can also be added using the cc and bcc attributes.
>>
>> static void MultipleRecipients()
>> {
>> //create the mail message
>> MailMessage mail = new MailMessage();
>>
>> //set the addresses
>> //to specify a friendly 'from' name, we use a different ctor
>> mail.From = new MailAddress("me@.company.com", "Me");
>>
>> //since the To,Cc, and Bcc accept addresses,
>> //we can use the same technique as the From address
>> //since the To, Cc, and Bcc properties are collections,
>> //to add multiple addreses, we simply call .Add(...) multple times
>>
>> mail.To.Add("you@.yourcompany.com");
>> mail.To.Add("you2@.yourcompany.com");
>> mail.CC.Add("cc1@.yourcompany.com");
>> mail.CC.Add("cc2@.yourcompany.com");
>> mail.Bcc.Add("blindcc1@.yourcompany.com");
>> mail.Bcc.Add("blindcc2@.yourcompany.com");
>>
>> //set the content
>> mail.Subject = "This is an email";
>> mail.Body = "this is the body content of the email.";
>>
>> //send the message
>> SmtpClient smtp = new SmtpClient("127.0.0.1");
>> smtp.Send(mail);
>> }
>>
>>
>>
>>
>> Juan T. Llibre, asp.net MVP
>> aspnetfaq.com : http://www.aspnetfaq.com/
>> asp.net faq : http://asp.net.do/faq/
>> foros de asp.net, en espaol : http://asp.net.do/foros/
>> ===================================
>> "Karl Seguin [MVP]" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message
>> news:eN2MefOWGHA.924@.TK2MSFTNGP03.phx.gbl...
>>>A mailAddress is used for a single person, the To property of the MailMessage is actually a
>>>collection...
>>>
>>> ur supposed to do:
>>>
>>> myMessage.To.Add(new MailAddress("email1'))
>>> myMessage.To.Add(new MailAddress("email2'))
>>> myMessage.To.Add(new MailAddress("email3'))
>>>
>>> Karl
>>>
>>> --
>>> http://www.openmymind.net/
>>> http://www.fuelindustries.com/
>>>
>>>
>>> "sck10" <sck10@.online.nospam> wrote in message news:eyEDvZOWGHA.4924@.TK2MSFTNGP05.phx.gbl...
>>>> Hello,
>>>>
>>>> I am trying to send email to 4 people (str01 =
>>>> "p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:
>>>>
>>>> Dim addrFrom As New MailAddress(str00)
>>>> Dim addrTo As New MailAddress(str01)
>>>>
>>>> My problem is that only the first person receives the email. When I check
>>>> the variable addrTo the value is "p1.mysite.com". Any help with this would
>>>> be appreciated.
>>>> --
>>>> Thanks in advance,
>>>>
>>>> sck10
>>>>
>>>>
>>>
>>>
>>
>>

Thursday, March 29, 2012

seperate bthe dll from a project working on multiple dlls

Hi ya,

i am working on a project which includes dll's of many projects

Now i want to seperate my app , because whenever a change is made in any of the included project , i have to recompile my project.

so can anyone suggest me ....how to seperate my application.

Thanks

one Solution file for One Project file is probably the best way to do it.

But maybe i dont understand you properly.

if you have one project, and you reference say, 5 .dll files from other projects. When those projects change, all you have to do is re-compile them, your project that references those ones should not need to be re-compilled, just the new .dll should overwrite the old one.

Creating a Solution with Project Dependancies can also simplify the process, that way if you need to mod a .dll your referencing, you already have the project in your solution.

HTH,

mcm

Tuesday, March 13, 2012

Server Application Unavailable

Issue:

We are hosting multiple Community Server sites on the same IP address using a host header running on 1.1 .NET Framework; also on the same server we are hosting sites running on the 2.0 .NET Framework. We average about three days of the site running and than we get the following error:

Server Application Unavailable

The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.

Fix:

Basically we would fix this by opening a command window and go to C:\WINDOWS\Microsoft.NET\Framweork\v1.1.4322 and typing aspnet_regiis-s W3SVC/1/ROOT/ and here we would enter the folder name or application. In this case we have named the folder VisualStudioToolsForOffice.com to reflect the domain visualstudiotoolsforoffice.com, so the full command would be aspnet_regiis -s W3SVC/1/ROOT/VisualStudioToolsForOffice.com. On doing this, we get this error:

C:\WINDOWS/Microsoft.NET\Framework\v1.14322>aspnet_regiis -s W3SVC/1/ROOT/visualstudiotoolsforoffice.com

Start registering ASP.NET scriptmap (1.1.4322.0) recursively at W3SVC/1/ROOT/visualstudiotoolsforoffice.com) is not a valid we application.

Installation stopped because the specified path (W3SVC/1/ROOT/visualstudiotoolsforoffice.com) is not a valid web application.

Here is the only way we have found to fix this: go to the Internet Information Services Manager (IIS), select websites and select the webite (in this case, visualstudiotooldforoffice.com), right click and select properties, select the ASP.NET tab, go to the drop down box for the ASP.NET version, select the 2.0 version and click apply and ok; right click and then selct properties, select the ASP.NET tab, then go to the drop down box for the ASP.NET version, select the 1.1 version and click apply and okay. Finally - NO server application unavailable error!. Any help from the community on a better resolve on this would be greatly appreciated, as going and repairing this every three days is a nuisance. Thanks in advance.

Okay, someone correct me if I am wrong, to install the scritpmaps, go to c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 and then type:

aspnet_regiis -s W3SVC/1/ROOT/VisualStudioToolsForOffice

VisualStudioToolsForOffice being the name of the application, so why am I still getting:

Start registering ASP.NET scriptmap (1.1.4322.0) recursively at W3SVC/1/ROOT/visualstudiotoolsforoffice.com) is not a valid we application.

Installation stopped because the specified path (W3SVC/1/ROOT/visualstudiotoolsforoffice.com) is not a valid web application.


I had the same problem and found a solution. First go to de IIS Admin Console, click on Web Sites a look for the identifier (a big number) of the site you want to upgrade de scriptmap. Then open a Command Line Console and typeaspnet_regiis -lk. It shows you the versions of the frameworks for each site. On this list find the line with the same identifier. Then type aspnet_regiis -s W3SVC/[identifier]/root/[optional if you have nested sites o directories].
Finally typeaspnet_regiis -lk again to check if it worked correctly. That's all.
LKZ:

Hello Kevin,

As far as I know, If you're trying to map that application to run under ASP.NET 1.1, I think you are doing it in the proper way.

I do not understand why raises that error. Those are the instructions stated in the Beta Doc and a book I've checked a few minutes ago about remapping web apps.
However, it may happen that the something could change about this since then, and the documentation it is not updated yet.
Good luck.


LuKiller wrote:

I had the same problem and found a solution. First go to de IIS Admin Console, click on Web Sites a look for the identifier (a big number) of the site you want to upgrade de scriptmap. Then open a Command Line Console and typeaspnet_regiis -lk. It shows you the versions of the frameworks for each site. On this list find the line with the same identifier. Then type aspnet_regiis -s W3SVC/[identifier]/root/[optional if you have nested sites o directories].
Finally typeaspnet_regiis -lk again to check if it worked correctly. That's all.
LKZ:


Okay, I ran aspnet_regiis -lk to list the site's and identifiers. Than I ran aspnet_regiis -s W3SVC/1903649274/root/VisualStudioToolsForOffice to set the scriptmaps and I still got the "Installation stopped because the specified path W3SVC/1903649274/root/visualstudiotoolsforoffice) is not a valid web application".
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>aspnet_regiis /lk
W3SVC/ 1.1.4322.0
W3SVC/1/ROOT/ 1.1.4322.0
W3SVC/1/ROOT/CertSrv/ 2.0.50215.44
W3SVC/1154147039/root/ 2.0.50215.44
W3SVC/1771324749/root/ 2.0.50215.44
W3SVC/1818541202/root/ 2.0.50215.44
W3SVC/1903649274/root/ 1.1.4322.0
W3SVC/53732026/root/ 1.1.4322.0
W3SVC/701625/root/ 1.1.4322.0

C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>aspnet_regiis -s W3SVC/1903649274/r
oot/visualstudiotoolsforoffice
Start registering ASP.NET scriptmap (1.1.4322.0) recursively at W3SVC/1903649274
/root/visualstudiotoolsforoffice.
Installation stopped because the specified path (W3SVC/1903649274/root/visualstu
diotoolsforoffice) is not a valid web application.