Error in asp while sending mail using MS outlook

R

Rishi

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
 
B

Bob Barrows

Rishi said:
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.aspx?scid=kb;en-us;257757
Use CDO. Start here:
http://www.aspfaq.com/search.asp?q=CDO&x=0&y=0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top