Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 12th, 2004, 02:17 PM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Email Problem .net

Hi there,

I am using .net Framework 1.1. I am trying to send email using vb.net(ASP.net). Using the web.mail namespace, which sends the mail fine. The problem is even though the mail gets sent, I get an error "Thread was being aborted" which means if I try email in a try...catch statement some of my code after the email code does not execute.

What is causing this error? I've tried everywhere and can't seem to find the answer, please help!

Copy of code
Try
'This works fine
objEmail = New MailMessage
            objEmail.To = ConfigurationSettings.AppSettings("adminEMail")
            objEmail.Priority = MailPriority.Normal
            objEmail.Subject = Subject
            objEmail.BodyFormat = MailFormat.Html
            objEmail.Body = Message
        objEmail.From = ConfigurationSettings.AppSettings("adminEMail")
        SmtpMail.SmtpServer = ConfigurationSettings.AppSettings("eMailServer")
        SmtpMail.Send(objEmail)

'Exception gets thrown when try to send mail
'Any code I put here will not execute because of exception being thrown

Catch ex1 as exception
'This is where I catch the "Thread was...." error
end try
 
Old December 12th, 2004, 02:32 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Cross post: http://p2p.wrox.com/topic.asp?TOPIC_ID=23394

Can you please not post the same message more than once? You message will be read anyway.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old December 13th, 2004, 10:11 AM
Friend of Wrox
 
Join Date: Feb 2004
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Check the SmtpServer you are accessing, also try with the Send method i.e. overloaded where you send the mail directly instead of creating a new mail object.



It is not how much we do,
but how much love we put in the doing.

-Mother Theresa





Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML email problem in asp.net sanjivbshinde ASP.NET 2.0 Professional 5 May 29th, 2008 06:49 AM
Problem sending email with SMTP in VB.Net Compiler Forum and Wrox.com Feedback 3 November 30th, 2007 07:25 PM
ASP.NET 2.0 Email Problem-Urgent sohrabus ASP.NET 2.0 Professional 3 October 6th, 2006 11:19 PM
Email Using .NET ramuis78 ASP.NET 1.0 and 1.1 Basics 5 September 4th, 2006 10:41 AM
email problem in asp.net raju_30339 ASP.NET 1.0 and 1.1 Basics 1 February 8th, 2005 09:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.