?
Solved

why send me error a CDO form send mail

Posted on 2012-04-11
4
Medium Priority
?
455 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 37835570
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
ID: 37838110
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
ID: 37839900
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
ID: 37854974
i solve it with tool provided by freecontactform.com

thanks

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

Featured Post

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

771 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