I have a classic asp project. On this project I need to send mail. I need helping hand to send mail from classical asp by using the bellow .config file information.
<appSettings>
<add key="smtpHost" value="smtp.gmail.com" />
<add key="smtpPort" value="587" />
<add key="emailTo" value="[email protected]" />
<add key="emailFrom" value="[email protected]" />
<add key="smtpUser" value="[email protected]" />
<add key="smtpUserPassword" value="test.smtp" />
<add key="emailSubject" value="Email Auto Reorder for callback" />
<add key="smtpDomain" value="" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
In asp.net I use bellow syntax to send mail
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add("[email protected]");
message.Subject = "This is the Subject line";
message.From = new System.Net.Mail.MailAddress("[email protected]");
message.Body = "This is the message body";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("yoursmtphost");
smtp.Send(message);
I'm just getting into classical asp, so forgive me if this is a basic question. I need help to send mail by using the .config file information .
I Just want to be able to send an email from my website to a given email address using my gmail account (smtp server). I have the following code which others have using successfully, but i get error
<%
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
''# Authenticate if necessary
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mygmailpassword"
''# Outgoing SMTP server configuration
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
''# Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = "[email protected]" ''# This has to be valid email address on the selected SMTP server
strSubject = "Email test"
strHTML = "This is a test"
objCDOSYSMail.To = "[email protected]"
objCDOSYSMail.Subject = strSubject
objCDOSYSMail.HTMLBody = strHTML
objCDOSYSMail.Send
%>
This is a discussion on Error: 006~ASP 0177~Server.CreateObject Failed~800401f3 –asp show me the above error . Can any one help please to solve this issue------------------------------------------------------------------------------------------- Without Set objCDOSYSMail = Server.CreateObject("CDO.Message")
The asp file was working fine on my os =win7 and win-server-2003 r2.