Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Прикладное программирование » Программирование "удобняшек" на VBScript (Часть 2)

Модерирует : ShIvADeSt

 Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

Открыть новую тему     Написать ответ в эту тему

vlary



Platinum Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору

Код:
 
'Sending a text email using authentication against a remote SMTP server
' Sample code submitted by Clint Baldwin,  +1 (918) 671 3429
Const cdoSendUsingPickup = 1  
Const cdoSendUsingPort = 2  
Const cdoAnonymous = 0
' Use basic (clear-text) authentication.  
Const cdoBasic = 1
' Use NTLM authentication  
Const cdoNTLM = 2 'NTLM
 
' Create the message object.
Set objMessage = CreateObject("CDO.Message")
'Set the from address this would be your email address.
objMessage.From = """Mail Info""<info@my-company.ru>"  
' Set the TO Address separate multiple address with a comma
objMessage.To = "vlary@anotherdomain.ru"
' Set the Subject.
objMessage.Subject = "An Email From Active Call Center."  
' Now for the Message Options Part.  
' Use standared text for the body.
objMessage.TextBody = _
"This is some sample message text.." & _
vbCRLF & _
"It was sent using SMTP authentication."
 
' Or you could use HTML as:
' objMessage.HTMLBody = strHTML
 
' ATTACHMENT : Add an attachment Can be any valid url
'objMessage.AddAttachment("file://C:\Program Files\Active Call Center\Examples\Goodbye.wav")
 
' This section provides the configuration information for the SMTP server.
' Specifie the method used to send messages.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = _
cdoSendUsingPort
 
' The name (DNS) or IP address of the machine  
' hosting the SMTP service through which  
' messages are to be sent.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"mail.my-company.ru" ' Or "mail.server.com"
 
' Specify the authentication mechanism  
' to use.  
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = _
cdoBasic
 
' The username for authenticating to an SMTP server using basic (clear-text) authentication
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = _
"info@my-company.ru"
 
' The password used to authenticate  
' to an SMTP server using authentication
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = _
"mypass"
 
' The port on which the SMTP service  
' specified by the smtpserver field is  
' listening for connections (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = _
465  
 
'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = _
True
 
' Set the number of seconds to wait for a valid socket to be established with the SMTP service before timing out.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = _
60
 
' Update configuration
objMessage.Configuration.Fields.Update
 
' Use to show the message.
' MsgBox objMessage.GetStream.ReadText
 
' Send the message.
objMessage.Send
 

Всего записей: 17280 | Зарегистр. 13-06-2007 | Отправлено: 15:17 19-10-2012
Открыть новую тему     Написать ответ в эту тему

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Прикладное программирование » Программирование "удобняшек" на VBScript (Часть 2)


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru