Для отправки почты с сайта Вы можете использовать компоненту CDO.NTS
Простое использование объекта NewMail и метода Send, пример:
******************
Dim myMail
Set myMail = CreateObject("CDONTS.NewMail") myMail.From = "
user2@example.com"
myMail.To = "
user@example.com"
myMail.Subject = "Sample Message"
myMail.Body = "This is a sample message."
myMail.AttachFile "d:\sample.txt"
myMail.Send
Set myMail = Nothing
*******************
Примерный пример отправки письма в формате HTML
*******************
Dim myMail
Set myMail = CreateObject("CDONTS.NewMail")
HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & vbCrLf
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<meta http-equiv=""Content-Type"""
HTML = HTML & ""content=""text/html; charset=iso-8859-1"">""
HTML = HTML & "<title>Sample NewMail</title>"
HTML = HTML & "</head>"
HTML = HTML & "<body>"
HTML = HTML & "This is a sample message being sent using HTML. <BR></body>"
HTML = HTML & "</html>"
myMail.From = "
user2@example.com"
myMail.To = "
user@example.com"
myMail.Subject = "Sample Message"
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = HTML
myMail.Send
Set myMail = Nothing
****************
Пример на JScript:
*************************
function SendEmail(from,to,subj,textbody,htmlbody)
{
try {
var msg = Server.CreateObject("CDO.Message");
msg.BodyPart.Charset = "windows-1251";
msg.MimeFormatted = true;
msg.From = from;
msg.To = to;
msg.BCC = "";
msg.Subject = subj;
if (htmlbody.length) {
msg.HTMLBody = htmlbody;
msg.HTMLBodyPart.Charset = "windows-1251";
}
if (textbody.length) {
msg.TextBody = textbody;
msg.TextBodyPart.Charset = "windows-1251";
}
msg.Send();
} catch (e) {
}
}
*************************
Article ID: 60, Created: May 7, 2008 at 6:27 PM, Modified: February 26, 2016 at 7:04 PM