Solved

why send me error a CDO form send mail

Posted on 2012-04-11
4
444 Views
Last Modified: 2012-04-17
hi

i have a form to send mail with CDO aqrquitecture, but it send me error when i click on send messsage

some one could help me to solve it?

i attach html file

this is the code:

<%

If request("submit") <> "" THEN
Set objEMail = Server.CreateObject("CDO.Message")
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Confi = objConfig.Fields
Confi("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Confi("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:inetpubmailrootpickup"
Confi.Update
Set objEMail.Configuration = objConfig
objEMail.To = "antonio.enriquez@valleredondo.com"
objEMail.From = Request("from")
objEMail.Subject = Request("subject")
objEMail.TextBody = Request("message")
objEMail.Send
Set objEMail = Nothing

Response.Write("Message Sent")
Else

%>

<form method="post" action="this.asp">
From Email: <INPUT type=text name="from"><br />
Subject: <INPUT type=text name="subject"><br />
Message: <TEXTAREA name="message" rows=10 cols=40></TEXTAREA><br />
<INPUT type="submit" value="Send" name="submit">
</form>

<%
End If
%>



problem is when i click on send message

send me message:

Internet Explorer can't show web page
index-2.html
0
Comment
Question by:tenriquez199
  • 3
4 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
What is the exact error and at what line?  

Try something simple like,
<%

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "This is a test"
objMessage.From = "me@MyDomain.com" ' This probably should be from the domain and email account set up on the server otherwise you need to use authentication.
objMessage.To = Request("to")
objMessage.TextBody =  Request("message")
objMessage.Send
%>

If you need to use authentication then try this

<%

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.From =  Request("from")  
objMessage.To = me@mydomain.com
objMessage.TextBody =  Request("message")


objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2


objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.myserver.com" '******This is YOUR smtp server info

'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objMessage.Configuration.Fields.Update

'==End remote SMTP server configuration section==

objMessage.Send
%>

One of the problems you may be  having is sending "from" an account other then what is associated with your server.  Instead, try using BOTH the From and To with your email address if all you want to do is send yourself the form data.  Then change the body from, objMessage.TextBody =  Request("message")  to objMessage.TextBody =  "From: "&Request("from")&"<br>" &Request("message")
0
 
LVL 1

Author Comment

by:tenriquez199
Comment Utility
hi padas

thanks your help

i did you tell me , but i don't have success

this is my code:

<%
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.From =  Request("from")  
objMessage.To = antonio.enriquez@valleredondo.com
objMessage.TextBody =  "From: "&Request("from")&"<br>" &Request("message")
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.digitalags.net" '******This is YOUR smtp server info
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objMessage.Send
%>



a question : is it rightly located my code within my html file?

thanks a lot

have you other comment?
index-9.html
0
 
LVL 1

Accepted Solution

by:
tenriquez199 earned 0 total points
Comment Utility
hi

i solve it with tool provided by freecontactform.com

thanks

http://www.freecontactform.com/free.php
0
 
LVL 1

Author Closing Comment

by:tenriquez199
Comment Utility
i solve it with tool provided by freecontactform.com

thanks

http://www.freecontactform.com/free.php
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now