email - 使用AutoIt发送电子邮件

标签 email autoit

如何使用AutoIt发送电子邮件?只需要一个干净的例子和解释,其中包括:

  • 主题
  • 消息
  • 最佳答案

    内置代码有两种主要的处理方式,_INetMail()或_INetSmtpMail()

    以下是帮助文件中的简单代码示例。如果您对帮助文件未涉及的工作方式或实现方式有任何疑问,请发表评论。

    我认为_INetSmtpMail()路由更合理。下面是它的一些示例代码。

    #include <INet.au3>
    
    $s_SmtpServer = "mysmtpserver.com.au"
    $s_FromName = "My Name"
    $s_FromAddress = "From eMail Address"
    $s_ToAddress = "To eMail Address"
    $s_Subject = "My Test UDF"
    Dim $as_Body[2]
    $as_Body[0] = "Testing the new email udf"
    $as_Body[1] = "Second Line"
    $Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
    $err = @error
    If $Response = 1 Then
        MsgBox(0, "Success!", "Mail sent")
    Else
        MsgBox(0, "Error!", "Mail failed with error code " & $err)
    EndIf
    

    _INetMail()方法使用在Windows中注册的内置邮件客户端。
    #include <INet.au3>
    
    $Address = InputBox('Address', 'Enter the E-Mail address to send message to')
    $Subject = InputBox('Subject', 'Enter a subject for the E-Mail')
    $Body = InputBox('Body', 'Enter the body (message) of the E-Mail')
    MsgBox(0,'E-Mail has been opened','The E-Mail has been opened and process identifier for the E-Mail client is ' & _INetMail($address, $subject, $body))
    

    关于email - 使用AutoIt发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3918747/

    相关文章:

    java - 无法使用 javamail 向 Gmail 发送 HTML 电子邮件

    PHP MYSQL日期邮件提醒

    autoit-如何最小化 ff.au3 上打开的窗口?

    c++ - AutoIt 和 C++。统一码

    Java Mail API - 编码问题

    html - Codeigniter 电子邮件 - 样式标签/CSS 不起作用

    c# - 使电子邮件标签成为超链接

    callback - AutoIt _Timer_SetTimer - 附加回调参数

    excel - 执行 AutoIt 并等待完成

    keyboard - 在autoit中限制鼠标和键盘?