Hello,
I am sending an e-mail and I need to call a function the following way:
1. Display("OK") if Email was SENT
2. Display("Error") if Email was NOT SENT
I have this code block:
Try
SmtpMail.Send(email)
Catch ex As Exception
Display("Error")
End Try
My problem is where to place Display("OK") which will only be called if
no exception is Catched, i.e., if the email was sent.
How can I do this?
Thanks,
Miguel 4 1253
Hi ,
Try
SmtpMail.Send(email)
Display("OK")
Catch ex As Exception
Display("Error")
End Try
Best regards....
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com>, haber iletisinde sunlari
yazdi:OM*************@tk2msftngp13.phx.gbl... Hello,
I am sending an e-mail and I need to call a function the following way:
1. Display("OK") if Email was SENT 2. Display("Error") if Email was NOT SENT
I have this code block:
Try SmtpMail.Send(email) Catch ex As Exception Display("Error") End Try
My problem is where to place Display("OK") which will only be called if no exception is Catched, i.e., if the email was sent.
How can I do this?
Thanks, Miguel
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:OM*************@tk2msftngp13.phx.gbl...
[snip] Try SmtpMail.Send(email) Catch ex As Exception Display("Error") End Try
My problem is where to place Display("OK") which will only be called if no exception is Catched, i.e., if the email was sent.
[snip]
Try
SmtpMail.Send(email)
Display("OK") // RIGHT HERE ****
Catch ex As Exception
Display("Error")
End Try
Try
SmtpMail.Send(email)
Display("Ok")
Catch ex As Exception
Display("Error")
End Try
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:OM*************@tk2msftngp13.phx.gbl... Hello,
I am sending an e-mail and I need to call a function the following way:
1. Display("OK") if Email was SENT 2. Display("Error") if Email was NOT SENT
I have this code block:
Try SmtpMail.Send(email) Catch ex As Exception Display("Error") End Try
My problem is where to place Display("OK") which will only be called if no exception is Catched, i.e., if the email was sent.
How can I do this?
Thanks, Miguel
Thanks to everybody for your help.
Miguel
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:uE*************@TK2MSFTNGP15.phx.gbl: Try SmtpMail.Send(email) Display("Ok") Catch ex As Exception Display("Error") End Try
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/ "Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message news:OM*************@tk2msftngp13.phx.gbl...
Hello,
I am sending an e-mail and I need to call a function the following way:
1. Display("OK") if Email was SENT 2. Display("Error") if Email was NOT SENT
I have this code block:
Try SmtpMail.Send(email) Catch ex As Exception Display("Error") End Try
My problem is where to place Display("OK") which will only be called if no exception is Catched, i.e., if the email was sent.
How can I do this?
Thanks, Miguel This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Gary.Hu |
last post by:
I was trying to catch the Arithmetic exception, unsuccessfully.
try{
int a = 0, b = 9;
b = b / a;
}catch(...){
cout << "arithmetic exception was catched!" << endl;
}
After ran the program,...
|
by: kaeli |
last post by:
Hey all,
I'd like to start using the try/catch construct in some scripts. Older
browsers don't support this. What's the best way to test for support for this
construct so it doesn't kill...
|
by: Abhishek Srivastava |
last post by:
Hello All,
I have seen code snippets like
try
{
.....
}
catch
{
|
by: Pohihihi |
last post by:
I was wondering what is the ill effect of using try catch in the code, both
nested and simple big one.
e.g.
try
{
\\ whole app code goes here
} catch (Exception ee) {}
|
by: Benny |
last post by:
Hi,
I have something like this:
try
{
// some code
}
catch // note - i am catching everything now
{
|
by: VB Programmer |
last post by:
Variable scope doesn't make sense to me when it comes to Try Catch Finally.
Example: In order to close/dispose a db connection you have to dim the
connection outside of the Try Catch Finally...
|
by: cj |
last post by:
Another wish of mine. I wish there was a way in the Try Catch structure
to say if there wasn't an error to do something. Like an else
statement. Try Catch Else Finally.
Also because I...
|
by: pigeonrandle |
last post by:
Hi,
Does this bit of code represent complete overkill?!
try
{
//create a treenode
TreeNode tn = new TreeNode();
//add it to a treeview
tv.Nodes.Add(tn);
|
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: 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...
|
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: 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: 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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |