Function SendMail()

On Error GoTo SendMail_Err
Dim oMSG As Object
Dim oConfig As Object
Dim CFields As Object
Dim strBody As String
Set oMSG = CreateObject("CDO.Message") '  Message   
Set oConfig = CreateObject("CDO.Configuration") '  Configuration   
Set CFields = oConfig.Fields
Set oMSG.Configuration = oConfig

' 
' ,  :(
'CFields("http://schemas.microsoft.com/cdo/configuration/proxy") = "192.168.0.1:80"

'1    Pickup, 2 -  SMTP
CFields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'SMTP 
CFields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.pochta.ru"

'SMTP 
CFields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

'SMTP SSL
CFields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

'SMTP timeout
CFields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

'SMTP 
'1 -  , 0    (), 2   NTLM.
CFields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

'
CFields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "leshke1@pisem.net"

'
CFields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "******"

'
CFields("urn:schemas:mailheader:content-language") = "windows-1251"
oMSG.BodyPart.Charset = "windows-1251"

CFields.Update

' 
oMSG.To = "leshke1@pisem.net"

' 
oMSG.From = "leshke1@pisem.net"

' 
oMSG.Subject = " " & Date & " " & Time

'  
oMSG.AddAttachment "D:\ \1.txt"
oMSG.AddAttachment "D:\ \2.txt"
oMSG.AddAttachment "D:\ \3.txt"

' 
strBody = " ... " & _
""

oMSG.HTMLBody = strBody ' 
oMSG.send '
' 
Set CFields = Nothing
Set oConfig = Nothing
Set oMSG = Nothing
MsgBox " ", , ""
SendMail_Exit:
Exit Function
SendMail_Err:
MsgBox Error$
Resume SendMail_Exit
End Function