Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Error in asp while sending mail using MS outlook

Reply
Thread Tools

Error in asp while sending mail using MS outlook

 
 
Rishi
Guest
Posts: n/a
 
      09-17-2009
Im using the below code to send a mail from my asp form.

Set ObjMail = Server.CreateObject("Outlook.Application")
Set ObjMsg = Server.CreateObject("Outlook.MailItem")
Set ObjMsg = ObjMail.CreateItem(0)
ObjMsg.To = Trim(Request.Form("txtto"))
ObjMsg.CC = Trim(Request.Form("txtCc"))
ObjMsg.BCC = Trim(Request.Form("txtBc"))
ObjMsg.Subject = Trim(Request.Form("txtSub"))
ObjMsg.HTMLBody = strBody
ObjMsg.Send

This is giving the error:

Server object, ASP 0177 (0x80080005)
Server execution failed
/MailTest.asp, line 56

But the same type code is working in vb application.

If anybody having ideal pls help us.

Regards,
Rishi
 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      09-17-2009
Rishi wrote:
> Im using the below code to send a mail from my asp form.
>
> Set ObjMail = Server.CreateObject("Outlook.Application")
> Set ObjMsg = Server.CreateObject("Outlook.MailItem")
> Set ObjMsg = ObjMail.CreateItem(0)
> ObjMsg.To = Trim(Request.Form("txtto"))
> ObjMsg.CC = Trim(Request.Form("txtCc"))
> ObjMsg.BCC = Trim(Request.Form("txtBc"))
> ObjMsg.Subject = Trim(Request.Form("txtSub"))
> ObjMsg.HTMLBody = strBody
> ObjMsg.Send
>
> This is giving the error:
>
> Server object, ASP 0177 (0x80080005)
> Server execution failed
> /MailTest.asp, line 56
>
> But the same type code is working in vb application.
>
> If anybody having ideal pls help us.
>

Don't try to use Outlook in ASP.
http://support.microsoft.com/default...b;en-us;257757
Use CDO. Start here:
http://www.aspfaq.com/search.asp?q=CDO&x=0&y=0

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
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
Error + Send Mail + ERROR: Failure sending mail. Don Quijote de Nicaragua ASP .Net 5 06-26-2008 01:13 PM
"Failure Sending Mail" when using System.Net.Mail and ASP.Net 2.0 HoustonComputerGuy@gmail.com ASP .Net 4 09-28-2007 03:57 PM
pls help me when i sent mail, it vil sending twice instead of once ,am using java.mail,am sending my code.... shailajabtech@gmail.com Java 0 09-28-2006 06:38 AM
Sending mail through Mail::Outlook paddyxmurphy@googlemail.com Perl Misc 2 05-25-2006 04:53 PM
Sending Mail Using ASP/VBScript to Exchange Mail Box martin smith ASP General 3 03-21-2005 06:45 PM



Advertisments