Solved

why send me error a CDO form send mail

Posted on 2012-04-11
4
451 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

738 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