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

Monday, March 26, 2012

System.Net.Mail and Multiple .To() addresses

I'm still milling over if it's a step forward or a step back on this one. Or, if I'm just missing something on it.
Is there a way to specify multiple email addresses in the To line of a message created with the new mail Namespace.
With the old namespace, I could just use address1@dotnet.itags.org.mail.com; address2@dotnet.itags.org.mail.com; address3@dotnet.itags.org.mail.com
This worked great, since it allowed everyone that was in the To line tobe visible, and not require sending 15 emails to the SMTP server, justone, and then it created what it needed to send out to each recipient.Now, I get an error that the recipient email is malformed, and can'tsend it. Know of any way around this?
Dim Msg As New MailMessage
Dim To_Addr As MailAddressCollection = Msg.To
To_Addr.Add(New MailAddress("address1@.mail.com", "Some Person"))
To_Addr.Add(New MailAddress("address2@.mail.com", "Some Other Person"))
To_Addr.Add(New MailAddress("address3@.mail.com")

Muchas Gracias. I'm still trying to get the hang of all of the changes, and my last solution was from-the-hip as it was. Apparently, ASP.NET 2.0 is much less forgiving of from-the-hip programming...
Now, for whatever reason, I've come up against a new error...

Server Error in '/' Application.

Compilation Error

Description:An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message:BC30516: Overload resolution failed because no accessible 'New' accepts this number of arguments.
Source Error:


Line 637: Dim strStake As String
Line 638:
Line 639: Dim objMessage As New MailMessage
Line 640: Dim emSubject As String
Line 641: Dim emBody As String


The code behind this is is exactly as it shows up there. So, I'm backto confused... if I take out the "New" I get "Not set to Instance of anObject" errors.


I think you need to put () at the end of New Mailmessage()
From the SDK:
Usage

Visual Basic
Dim mailMessage1 As NewMailMessage()


According to Microsoft, the ";" separated [To] adress list string should work - see the SMTP send method at :
http://msdn2.microsoft.com/en-us/library/h1s04he7

No, I get the same error, unfortunately.

Thursday, March 22, 2012

System.OutOfMemoryException error

Hi,

I migrated our company's ASP.Net web appplication from a regular Pentium 4
machine to a multiple xeon processors machine. The web application was
acceptable in speed on the old machine, I was expecting to get a better
performance in speed when I did the migration. But neither users or I felt
the difference since the migration.

This is fine. But now I have been getting System.OutOfMemoryException errors
from different ASP.Net pages every now and then on the new machine, same
problems never happened to the old machine. Both machines are running
Windows 2000 sever with SP4.

Any Ideas why System.OutOfMemoryException errors happen to faster machines?

TIAyou probably have thread race conditions that never happened on a single
processor system. check for correct locking on all static variables (vb
modules).

-- bruce (sqlwork.com)

"Ed Chiu" <EdChiu@.discussions.microsoft.com> wrote in message
news:F2D84B2D-4CC6-4DC5-AB4D-D51B16CA5488@.microsoft.com...
> Hi,
> I migrated our company's ASP.Net web appplication from a regular Pentium 4
> machine to a multiple xeon processors machine. The web application was
> acceptable in speed on the old machine, I was expecting to get a better
> performance in speed when I did the migration. But neither users or I felt
> the difference since the migration.
> This is fine. But now I have been getting System.OutOfMemoryException
> errors
> from different ASP.Net pages every now and then on the new machine, same
> problems never happened to the old machine. Both machines are running
> Windows 2000 sever with SP4.
> Any Ideas why System.OutOfMemoryException errors happen to faster
> machines?
> TIA
Thank you for the reponse. But I don't understand you response.

For starter, what is "thread race conditions"? Secondly, why do I need to
lock static variables?

I only have one instance of aspnet_wp .exe running, I do not create web farm
or web garden environment.

Thanks Again

"Bruce Barker" wrote:

> you probably have thread race conditions that never happened on a single
> processor system. check for correct locking on all static variables (vb
> modules).
> -- bruce (sqlwork.com)
>
> "Ed Chiu" <EdChiu@.discussions.microsoft.com> wrote in message
> news:F2D84B2D-4CC6-4DC5-AB4D-D51B16CA5488@.microsoft.com...
> > Hi,
> > I migrated our company's ASP.Net web appplication from a regular Pentium 4
> > machine to a multiple xeon processors machine. The web application was
> > acceptable in speed on the old machine, I was expecting to get a better
> > performance in speed when I did the migration. But neither users or I felt
> > the difference since the migration.
> > This is fine. But now I have been getting System.OutOfMemoryException
> > errors
> > from different ASP.Net pages every now and then on the new machine, same
> > problems never happened to the old machine. Both machines are running
> > Windows 2000 sever with SP4.
> > Any Ideas why System.OutOfMemoryException errors happen to faster
> > machines?
> > TIA
>
> you probably have thread race conditions that never happened on a single
> processor system. check for correct locking on all static variables (vb
> modules).
> -- bruce (sqlwork.com)

I agree.

If both of the following conditions are true:
1. Your database is in an SQL Server or MSDE
2. That SQL Server lives on the same box as your web server
Then:

Beware of "Parallelism". SQL Server, on a multiprocessor box may "break up"
activities of your SQL so that portions of an activity runs in parallel
through multiple CPU's and then SQL Server gathers up the results from each
thread and then serializes them back together. Occasionally, depending on
the nature of the SQL syntax, these "Parallelized threads" can deadlock each
other.

I have only seen this occasionally, but if you want to try it out, dig
through your code to locate any SQL that might be executing when your
application displays this behavior. You can then run SQL Server Query
Analyzer, Set the "Show Execution Plan" option, paste your SQL code, run it,
and then look at the "Execution Plan" tab. If you see any icons that
mention parallelism, then you might consider adding the OPTION (MAXDOP 1)
query hint to your SQL:

SELECT foo
FROM Bar
WHERE fee = fum
OPTION (MAXDOP 1)

"MAXDOP" means "MAXimum Degree Of Parallelism", basically telling SQL Server
to not split the operation over more than one CPU.

If you think that this Parallelism thing is your problem, you can do a "Full
Text Search" on "MAXDOP" in SQL Server Books Online. I cannot imagine why
it doesn't have an index entry.

You could also ask about it over in the
microsoft.public.sqlserver.programming newsgroup.
--
Peace & happy computing,

Mike Labosh, MCSD

"Mr. McKittrick, after very careful consideration, I have
come to the conclusion that this new system SUCKS."
-- General Barringer, "War Games"
I am sorry, the SQL server runs in another server, not with thw web sever.
Please remember we never experienced the same problems with the old web
server.

"Mike Labosh" wrote:

> > you probably have thread race conditions that never happened on a single
> > processor system. check for correct locking on all static variables (vb
> > modules).
> > -- bruce (sqlwork.com)
> I agree.
> If both of the following conditions are true:
> 1. Your database is in an SQL Server or MSDE
> 2. That SQL Server lives on the same box as your web server
> Then:
> Beware of "Parallelism". SQL Server, on a multiprocessor box may "break up"
> activities of your SQL so that portions of an activity runs in parallel
> through multiple CPU's and then SQL Server gathers up the results from each
> thread and then serializes them back together. Occasionally, depending on
> the nature of the SQL syntax, these "Parallelized threads" can deadlock each
> other.
> I have only seen this occasionally, but if you want to try it out, dig
> through your code to locate any SQL that might be executing when your
> application displays this behavior. You can then run SQL Server Query
> Analyzer, Set the "Show Execution Plan" option, paste your SQL code, run it,
> and then look at the "Execution Plan" tab. If you see any icons that
> mention parallelism, then you might consider adding the OPTION (MAXDOP 1)
> query hint to your SQL:
> SELECT foo
> FROM Bar
> WHERE fee = fum
> OPTION (MAXDOP 1)
> "MAXDOP" means "MAXimum Degree Of Parallelism", basically telling SQL Server
> to not split the operation over more than one CPU.
> If you think that this Parallelism thing is your problem, you can do a "Full
> Text Search" on "MAXDOP" in SQL Server Books Online. I cannot imagine why
> it doesn't have an index entry.
> You could also ask about it over in the
> microsoft.public.sqlserver.programming newsgroup.
> --
> Peace & happy computing,
> Mike Labosh, MCSD
> "Mr. McKittrick, after very careful consideration, I have
> come to the conclusion that this new system SUCKS."
> -- General Barringer, "War Games"
>