ник: SerRock
smtp сервер корпоративный, я в сети ... у меня есть выход в i-net, почта ... может как то не так надо?
на всякий случай привоже код, но он в принципе Ваш, хотя ...
Dim oMSG As Object
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim oConfig As Object
Dim CFields As Object
Dim strBody As String
Set db = CurrentDb
Set rst = db.OpenRecordset("Address_Test")
Set oMSG = CreateObject("CDO.Message")
Set oConfig = CreateObject("CDO.Configuration")
Set CFields = oConfig.Fields
Set oMSG.Configuration = oConfig
CFields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
CFields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.ru"
CFields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'CFields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
CFields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "rokin999" 'Login
CFields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "123456789" 'password
CFields("urn:schemas:mailheader:content-language") = "windows-1251"
CFields.Update
oMSG.To = "rokin@r66.ru"
oMSG.From = "rokin999@mail.ru"
oMSG.Subject = "Theam"
oMSG.BodyPart.Charset = "windows-1251"
oMSG.AddAttachment "c:\temp\Test0.rtf"
strBody = "123"
oMSG.TextBody = strBody
oMSG.Send
Set CFields = Nothing
Set oConfig = Nothing
Set oMSG = Nothing
|