Hi im doing a ASP contact form and for some reason i keep getting this.
Server object error ‘ASP 0177 : 800401f3’
Server.CreateObject Failed
/confirmation.asp, line 10
800401f3
I think that theres something wrong with my STMP, please any help would be greatful.
<%
DIM strEmail, strFirstName, strLastName, strSubject, strComments
strEmail = request.form("Email")
strFirstName = request.form("FirstName")
strLastName = request.form("LastName")
strSubject = request.form("Subject")
strComments = request.form("Comments")
DIM Mailer,strMsgHeader, qryItem, strMsgInfo
Set Mailer = Server.CreateObject("smtpout.secureserver.net") // this line might be wrong.
Mailer.FromName = "Web Designs"
Mailer.FromAddress= "carlos@example.net"
Mailer.ReplyTo = strEmail
Mailer.RemoteHost = "mail.example.net"
Mailer.AddRecipient "", ""
Mailer.Subject = "Online Inquiry"
strMsgHeader = "This mail message was sent from the www.webdesigns.com Online Form" & vbCrLf & vbCrLf
Mailer.BodyText = strMsgHeader & vbCrLf & "Email: " & Request.Form("Email") & _
vbCrLf & "First Name: " & Request.Form("FirstName") & _
vbCrLf & "Last Name: " & Request.Form("LastName") & _
vbCrLf & "Subject: " & Request.Form("Subject") & _
vbCrLf & "Comments: " & Request.Form("Comments")
IF Mailer.SendMail THEN
Response.Write strFirstName & ",<br>"
Response.Write "Your message has been successfully sent."
ELSE
Response.Write "The following error occurred while sending your message: " & Mailer.Response
END IF
%>
If you are going to send this MailMessage you need smtpClient from your email provider.
Try
Dim message As New MailMessage()
Dim fromAdd As MailAddress = New MailAddress("sendfrom@email.com")
With Mailer
.[To].Add("sendto@email.com")
.Subject = "Choose Session Members"
.From = fromAdd
.IsBodyHtml = True
.Priority = MailPriority.Normal
.BodyEncoding = Encoding.Default
.Body = ""
End With
Dim host = Request.Url.Host
Dim smtpClient As New SmtpClient("smtp.email.com", "25")
With smtpClient
.EnableSsl = True
.UseDefaultCredentials = False
.Credentials = New System.Net.NetworkCredential("name@email.com", "password")
.DeliveryMethod = SmtpDeliveryMethod.Network
.Send(message)
.Dispose()
End With
Catch ex As Exception
Throw ex
End Try
Next time write your own post do not add to others!
try {
MailMessage message = new MailMessage();
MailAddress fromAdd = new MailAddress("sendfrom@email.com");
var _with1 = Mailer;
_with1.To.Add("sendto@email.com");
_with1.Subject = "Choose Session Members";
_with1.From = fromAdd;
_with1.IsBodyHtml = true;
_with1.Priority = MailPriority.Normal;
_with1.BodyEncoding = Encoding.Default;
_with1.Body = "";
dynamic host = Request.Url.Host;
SmtpClient smtpClient = new SmtpClient("smtp.email.com", "25");
var _with2 = smtpClient;
_with2.EnableSsl = true;
_with2.UseDefaultCredentials = false;
_with2.Credentials = new System.Net.NetworkCredential("name@email.com", "password");
_with2.DeliveryMethod = SmtpDeliveryMethod.Network;
_with2.Send(message);
_with2.Dispose();
} catch (Exception ex) {
throw ex;
}
your getting this error " ASP 0177 : 800401f3" because the WebClass Runtime file (Mswcrun.dll) does not exist on your Web server, or WebClass Runtime is not registered. WebClass Runtime is one of the system files required for your
WebClass applications to function properly.