Dima1337
Осваивающий
- Сообщения
- 186
- Репутация
- 24
Доброго времени суток, на просторах форума нашел:
Выдает ошибку
Как справиться?
joiner сказал(а):не знаю как, но работает
autoit 3.3.12.0
Код:#AutoIt3Wrapper_Run_AU3Check= N #include <File.au3> $SmtpServer = 'smtp.yandex.ru' $FromAddress = 'логин@yandex.ru' $Username = 'логин' $Password = 'пароль' $ToAddress = 'адресат@inbox.ru' $Subject = 'тема письма' $Body = 'содержание письма' _INetSmtpMailCom($SmtpServer, '', $FromAddress, $ToAddress, $Subject, $Body, '', '', '', $Username, $Password) Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $s_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 1) $objEmail = ObjCreate("CDO.Message") $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>' $objEmail.To = $s_ToAddress Local $i_Error = 0 Local $i_Error_desciption = "" If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress $objEmail.Subject = $s_Subject If StringInStr($s_Body, "<") And StringInStr($s_Body, ">") Then $objEmail.HTMLBody = $s_Body Else $objEmail.Textbody = $s_Body & @CRLF EndIf If $s_AttachFiles <> "" Then Local $S_Files2Attach = StringSplit($s_AttachFiles, ";") For $x = 1 To $S_Files2Attach[0] $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x]) If FileExists($S_Files2Attach[$x]) Then $objEmail.AddAttachment($S_Files2Attach[$x]) Else $i_Error_desciption = $i_Error_desciption & @LF & 'File not found to attach: ' & $S_Files2Attach[$x] SetError(1) Return 0 EndIf Next EndIf $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort If $s_Username <> "" Then $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password EndIf If $ssl Then $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True EndIf $objEmail.Configuration.Fields.Update $objEmail.Send If @error Then SetError(2) EndIf EndFunc ;==>_INetSmtpMailCom
Код:
$objEmail.Send
$objEmail^ ERROR