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

MailMessage = Nothing

I've got a VB.NET web service that checks an email queue in a database.
We've been getting a spike in the RPC service on the email server. The
service is not running on the email server that it's using to send the email.

Dim emailTable As DataTable
Dim i As Integer
Dim Message As New MailMessage
Dim MailServer As SmtpMail

Try
'get a table with the queued emails
emailTable = CheckQueue()

For i = 0 To emailTable.Rows.Count - 1
Message.To =
NullToEmptyString(emailTable.Rows(i).Item("to_addr ess"))
Message.From =
NullToEmptyString(emailTable.Rows(i).Item("from_ad dress"))
Message.Cc =
NullToEmptyString(emailTable.Rows(i).Item("cc_addr ess"))
Message.Body =
NullToEmptyString(emailTable.Rows(i).Item("bcc_add ress"))
Message.Subject =
NullToEmptyString(emailTable.Rows(i).Item("subject "))
Message.Body =
NullToEmptyString(emailTable.Rows(i).Item("body"))
Message.BodyFormat = MailFormat.Html

MailServer.SmtpServer = "mail.corp.com"
MailServer.Send(Message)
Next

Catch ex As System.Exception

Finally
Message = Nothing
End Try

I'm thinking the Message = Nothing might be the problem, as the object is
unmanaged?? I could pull it out, but the problem is on and off, so I
couldn't be sure that's the fix.

Any suggestions.

Dan
Aug 8 '05 #1
0 1035

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

Similar topics

5
by: martin | last post by:
Hi, I have created a class that is totally seperate from my web application. However this class is used extensivly by the web application for stuff like data access. I wish to add a function to...
0
by: gh0st54 | last post by:
Hi i'm looking for how to change the date of out going messages i tried this but it doesn't seems to work static public bool SendEmail(string To, string From, string Subject, string Body,...
4
by: Aren Cambre | last post by:
Why does SmtpMail.Send throw an exception if the MailMessage's BodyFormat = MailFormat.Html? I've searched all over the place and cannot find a solution anywhere. I am running this on Windows XP...
3
by: Anthony Fine | last post by:
Hello All, I have a VB.Net app that needs to send mail. I have created a class for building my e-mail, but keep getting the error (Could not access 'CDO.Message' object.) when trying to send...
6
by: Jul | last post by:
Hi, I use MailMessage class for create email. I specify such settings: mmEmail = New MailMessage mmEmail.To = ".." mmEmail.Body = "..." mmEmail.Subject = "..." mmEmail.BodyFormat =...
0
by: edwilli | last post by:
I've got a VB.NET web service that checks an email queue in a database. We've been getting a spike in the RPC service on the email server. The service is not running on the email server that it's...
0
by: Scott Townsend | last post by:
I'm trying to send an email and get a delivery receipt back. I'm setting the MailMessage.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess and it works great for the First email...
4
by: a | last post by:
Hi I want my application uses the instance of MailMessage and SmtpMail classes to send email. How can I add a reference to the System.Web.dll assembly to use these classes? Do the SmtpMail...
2
by: =?Utf-8?B?Q2FwdGFpbiBEYXZlIQ==?= | last post by:
I wrote some code to send an email with two alternate views: 1) html 2) plain text All the html enabled email clients accept the html just fine and disregard the plain text version. 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: 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$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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...
0
Oralloy
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,...
0
jinu1996
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...

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.