Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Send Email with MAPI

Reply
Thread Tools

Send Email with MAPI

 
 
madfisher
Guest
Posts: n/a
 
      01-12-2006
Hi,

I am trying to send an email with MAP via C# and ASP.NET. This is what
I'm doing.

MapiSession1 = new MSMAPI.MAPISessionClass();
MapiSession1.UserName = "OutlookProfileName";
MapiSession1.Password = "pass";
MapiSession1.LogonUI = false;
MapiSession1.SignOn();
MapiSession1.NewSession = true;

MapiMessages1 = new MSMAPI.MAPIMessagesClass();
MapiMessages1.SessionID = MapiSession1.SessionID;
MapiMessages1.Compose();
MapiMessages1.RecipAddress = "";

MapiMessages1.MsgSubject = "New Build Requested";
MapiMessages1.MsgNoteText = "A new build has been requested.";
MapiMessages1.Send(null);

MapiSession1.SignOff();

I'm getting the following error:
System.Runtime.InteropServices.COMException: Login has failed

I'm am using my Outlook (Exchange profile info) which should be right.
Am I going about this the right way?

Thanks in advance.

Marcus de Leon

 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      01-12-2006
Marcus,
If your Exchange server offers SMTP you should find that a lot easier using
either System.Web.Mail (System.Net.Mail for ASP.NET 2.0) or any of a number
of free, open source SMTP Libraries such as OpenSMTP.
I hate MAPI.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"madfisher" wrote:

> Hi,
>
> I am trying to send an email with MAP via C# and ASP.NET. This is what
> I'm doing.
>
> MapiSession1 = new MSMAPI.MAPISessionClass();
> MapiSession1.UserName = "OutlookProfileName";
> MapiSession1.Password = "pass";
> MapiSession1.LogonUI = false;
> MapiSession1.SignOn();
> MapiSession1.NewSession = true;
>
> MapiMessages1 = new MSMAPI.MAPIMessagesClass();
> MapiMessages1.SessionID = MapiSession1.SessionID;
> MapiMessages1.Compose();
> MapiMessages1.RecipAddress = "";
>
> MapiMessages1.MsgSubject = "New Build Requested";
> MapiMessages1.MsgNoteText = "A new build has been requested.";
> MapiMessages1.Send(null);
>
> MapiSession1.SignOff();
>
> I'm getting the following error:
> System.Runtime.InteropServices.COMException: Login has failed
>
> I'm am using my Outlook (Exchange profile info) which should be right.
> Am I going about this the right way?
>
> Thanks in advance.
>
> Marcus de Leon
>
>

 
Reply With Quote
 
 
 
 
madfisher
Guest
Posts: n/a
 
      01-12-2006
Yeah I know what you mean, SMTP would be much better, however the ports
are blocked here at work and smtp isn't an option for me. Messages go
in the Queue and don't get sent b/c it is unable to contact the server.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows: Mapi wrapper to redirect email to a script? jk314@gmx.at Perl Misc 0 09-18-2007 09:59 PM
MAPI extension for non-MAPI enabled email clients? hugh jass Computer Support 0 02-11-2005 12:20 PM
Thunderbird , MAPI & VB6 trixar Firefox 0 12-12-2004 11:27 PM
Getting MAPI to fetch() from a different directory? Ted ASP .Net 1 07-03-2004 07:30 PM
Error occurred while initializing MAPI in Outlook Express 6 Michael MCSE 5 09-17-2003 05:39 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57