Solved

why send me error a CDO form send mail

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
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.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

718 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