Helllo, i am calling ASP page from HTML on click of submit button, and in ASP i want to send Email. So i have writen below code, but neither it is sending mail nor i am getting any Error.
<%
dim myMail
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="FromEmail"
myMail.To="ToEmail"
myMail.HTMLBody = "<h1>This is a message.</h1>"
On Error Resume Next
myMail.Send
If Err.Number = 0 then
Response.ContentType="application/json"
Response.Write "{ request: 'success'}"
Else
Response.ContentType="application/json"
Response.Write "{ request: 'failed'}"
End If
set myMail=nothing
%>
Can anyone please help me on this..?
This code also includes RegExp to prevent your email form from being used by spammers.
The configuration fields have been commented for your convenience. If your web host mail server does not require authentication you can omit the last three Configuration fields (authentication, username & password).
In this line 'expressionmatch = RegularExpressionObject.Test(Request.Form("E-mail"))' the word "E-mail" is the name of the form field containing the sender's email address.