Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Processing Code

Status
Not open for further replies.

relin

Programmer
Jul 29, 2009
8
I have several websites that have a html form with a cdosys.asp processing page. I found out today that GoDaddy has outgoing mail restrictions for sbcglobal.net, hotmail, etc. Those addresses can’t be put into a form. I get Error 800402e and error 500 (there is a problem with the resource you are looking for...) Is there a way to change my code below to allow these email addresses to be processed through the form.

When I talk to godaddy they say I have to have something like this:
// language -- C#
// import namespace
using System.Web.Mail;

private void SendEmail()
{
const string SERVER = "relay-hosting.secureserver.net";
MailMessage oMail = new System.Web.Mail.MailMessage();
oMail.From = "emailaddress@domainname";
oMail.To = "emailaddress@domainname";
oMail.Subject = "Test email subject";
oMail.BodyFormat = MailFormat.Html; // enumeration
oMail.Priority = MailPriority.High; // enumeration
oMail.Body = "Sent at: " + DateTime.Now;
SmtpMail.SmtpServer = SERVER;
SmtpMail.Send(oMail);
oMail = null; // free up resources

I do not believe this is for ASP, but for ASP.net. Where do I put this in? I have no idea how to incorporate this.

THIS IS MY CODE for bandstaxidermy.com. Your help is greatly appreciated!!!!

<%
If Not Request.Form("Trophy") = "Trophy" Then
Response.Redirect "End If
%>
<%
For Field = 1 to Request.Form.Count - 3
FieldName = Replace(Request.Form.Key(Field),"_"," ")
FieldValue = Request.Form.Item(Field)
Body = Body & FieldName & ": " & FieldValue & VbCrLf
Next
'Dimension variables
Dim objCDOSYSCon
'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
'Set and update fields properties
With objCDOSYSCon
'Outgoing SMTP server
.Fields("
.Fields(" = 25
'CDO Port
.Fields(" = 2
'Timeout
.Fields(" = 60

.Fields.Update
End With
'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
'Set and update email properties
With objCDOSYSMail
'0=Low, 1=Normal, 2=High
.Fields("urn:schemas:httpmail:importance").Value = 1
'Who the e-mail is from
.From = Request.Form("email")
'Who the e-mail is sent to
.To = "name@domain.com"
'Who the e-mail is CC'd to
'.Cc = ""
'The subject of the e-mail
.Subject = Request.Form("email_subject")
'Set the e-mail body format (HTMLBody=HTML TextBody=Plain)
.TextBody = Body
.Fields.Update
'Send the e-mail
.Send
End With
'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
'Rederect after sending email
Response.Redirect Request.Form("redirect_to")
%>
 
If your mail server is not accepting email addresses then there is little you can, perhaps change mailserver / hosting company ?

There is a .Net forum at which may yield better results on the .Net side.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
It will accept email addresses, just not certain ones. It won't accept sbcglobal.net, hotmail, etc. It will accept att.net, etc. It is just a "blacklist" they have. My ASP is plain old ASP, not ASP.net.
 
If they are blacklisted then you will not be able to send those emails, although you could detect the address in your code and use another server.

The code they have shown you is for .Net not Classic ASP, so I would go back and ask them the following :

1. Can you provide a Classic ASP example ?
2. Is Classic ASP still supported ?

If you have the server information, which does seem to be in their sample you should be able to rearrange the data and put it into your Classic ASP page.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top