Email Application

  • Thread starter Thread starter Cristina
  • Start date Start date
C

Cristina

In order to send automated email from my application I
have used MAPI controls.Unfortunatly I don't know how
to handle the MAPI control Error Messages described here
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/mapi98/html/mapicontrolserrs.asp.

For example if my mail doesn't have any attachment I would
like to trap the error
mapAttachmentNotFound - 32011 - Attchment not found.
In my application I'm handling exception and in this case
the error displayed is "Unspecified failure has occured".

Thanks
 
Why don't you use CDO instead of MAPI

You can also sa

On Error Goto myError ' VB 6

...

myError

select case err.Numbe

Case ' No attachment error number her
' Handle error here (i.e. Resume Next
Case Els
' Handle other errors her
End Selec

If you're using VB.NET the use the Try - Catch - End Try bloc
 
Olá Cristina

Use System.Web.Mail.SmtpMail its simplier to use.

Kind Regards
Jorge Cavalheiro
 
=?Utf-8?B?SGVscGZ1bA==?= said:
Why don't you use CDO instead of MAPI?

CDO isnt installed on all machines and is limited in functionality. If your
not stuck to MAPI, try Indy. Its free:

http://www.indyproject.org/

Basic mail demo in VB at:
http://www.atozed.com/indy/
On Error Goto myError ' VB 6

Ack! Dont use those. Those are old error handling mechanisms and should die.
use try blocks instead.
If you're using VB.NET the use the Try - Catch - End Try block

Yes exactly. :)
 
Back
Top