473,404 Members | 2,137 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,404 software developers and data experts.

How to make cdo.Message throw an exception if invalid email address is entered.

billiy321
Hi

I am trying to send a mail in C# without having to use an SMTP server(using SMTP service instead) with " cdoSendUsingPickup " configuration. But when i enter a invalid recipient adderss say blablabla@crap.com.au, only moves the mail into the folder "C:\Inetpub\mailroot\Drop" but doesnt throw an exception. What i want to be able to do is if something like this happens it should throw an exception or alert saying mail has not been sent due to bla bla bla reason. Any suggestions

cheers
Feb 3 '10 #1
5 3788
alexis4
113 100+
if something like this happens it should throw an exception or alert saying mail has not been sent due to bla bla bla reason
There are ways to create and throw your own exception, but a simple try-catch won't do?
Feb 3 '10 #2
@alexis4
Hey thnx for replying.
Na simple try-catch wont do coz if i enter some invalid email id, the SMTP service just moves that mail into a special folder and doesnt throw any exception...and I've actually just thought of a better way to put my question. I want a delivery status notification(sent or failed) in C# when i am using the below code

CDO.Message mail = new CDO.Message();
CDO.IConfiguration iConfg = mail.Configuration;
ADODB.Fields oFields = iConfg.Fields;


ADODB.Field oField =oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"];

oField.Value = 1;(which means send using pickup directory not smtp server port etc etc)

oFields.Update();
Feb 3 '10 #3
tlhintoq
3,525 Expert 2GB
SMTP service just moves that mail into a special folder
How about using a FileSystemWatcher to keep an eye on that special folder. Then you can parse any new messages that show up
Feb 4 '10 #4
Yea thats exactly what i had thought but the problem is A: Its in a stupid format(.eml) and B: The data inside is not consistent so cant really pic it up and parse whats within.....Guess theres no usefull way how bizarre. My BA wants me to make this stupid C# application, send emails without using our SMTP server. And only way i could do it is by using the IIS SMTP Service but seems thats not too useful either:(:(:(
Feb 4 '10 #5
tlhintoq
3,525 Expert 2GB
You give up way too easily. Do you really think you're the first person who needed to parse and email file? Google dude. "C# parse .eml"
http://bytes.com/topic/c-sharp/answe...-email-message
http://social.msdn.microsoft.com/For...e-4b91f591caa7

The email format (.eml) is pretty common.
Feb 4 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: Jonah Olsson | last post by:
Hi guys, I need a way to dynamically change (or create) a custom class using an external xml file. Can this be done at all? This is what the class looks like: Public Class MemberData Private...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
1
by: cindy | last post by:
this is the call private void Page_Load(object sender, System.EventArgs e) { OdbcConnection connection = new OdbcConnection ("DSN=PFW52"); CreateDataAdapter(connection); } this is the code,...
3
by: Ryan Liu | last post by:
Hi, In the .NET Framework SDK documentation, I can see DataRow.AcceptChanges method will throw RowNotInTableException exeception. And in DataTable.AcceptChanges(), the documentation does not...
2
by: petschy | last post by:
hello all, i'm writing network message processors for a server app. after dispatching, the processor function is called for the given message type. the tokens in the message are validated,...
2
by: dougloj | last post by:
Hi. I have an ASP.NET application written in C#. To log in, a user must provide their email address and password. I already give the user a "Remember my Email Address" check box. If they check...
28
by: Jess | last post by:
Hello, It is said that if I implement a "swap" member function, then it should never throw any exception. However, if I implement "swap" non- member function, then the restriction doesn't...
1
by: =?Utf-8?B?UGF1bCBQaGlsbGlwcw==?= | last post by:
I have read many things about this but I haven't got a clear vision on what to do if anything about this. I have a system that tries to find holes in my web site. One of the things it has...
4
by: Clodoaldo | last post by:
I need to know if an email was refused for whatever reason, it makes no difference. The email is sent to an email address that does not exist in a foreign domain. I can see in the postfix log...
9
by: TC | last post by:
Hey All, I posted this to the Crypto users group and forgot to add the VB.Net users group. I apologize for any confusion. I have been testing a try / catch / finally block and purposely...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
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,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
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,...
0
isladogs
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 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.