Solved

why send me error a CDO form send mail

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
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 …

947 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

21 Experts available now in Live!

Get 1:1 Help Now