ник: k@s
Попробуй это код , у меня работает.
On Error Resume Next
Dim MsgText, MsgFrom, Otkuda
Dim objEmail
Set objEmail = CreateObject("CDO.Message")
Otkuda = InputBox("Город")
objEmail.BodyPart.Charset = "windows-1251"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "rokin999"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "123456789"
MsgFrom = ("rokin999@mail.ru")
objEmail.From = MsgFrom
objEmail.AddAttachment ("c:\text.txt")
objEmail.AddAttachment ("c:\text1.txt")
objEmail.To = "rokin999@mail.ru"
'objEmail.From = MsgSubject
objEmail.Subject = Otkuda
objEmail.TextBody = MsgText '("text")
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.ru"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
If Err.Number <> 0 Then
MsgBox "Отправка письма невозможна по причине: " & Err.Description, , Err.Number
Else
'DoCmd.Close acForm, Me.Name
MsgBox "Сообщение " & ("") & " успешно отправлено."
Err.Clear
End If
Set objEmail = Nothing