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

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top