那些有趣的小事

這世界怎麼這麼多有趣的小事?

  • Licensing
  • Thanks for your help!
  • VEGA Hunter
  • 商店
  • 我的帳號
  • 結帳
  • 購物車
  • 隱私權政策

按鍵精靈 發送 email 的 bug 解決方法

Posted by admin on 2016-07-20
Posted in: GAME, Utility. Tagged: 按鍵精靈. Leave a Comment

使用的版本是 按鍵精靈繁體版 2014.02.15453

編輯器會過濾幾個 關鍵字

  • .Bodypart.Charset
  • .To
  • .HTMLBodypart.Charset

最麻煩的是 .To  目前還沒找到方法解決,只能用 .cc 來收信。不然會完全無法設定接收。

.Bodypart.Charset  這個還有辦法解決,只要把它拿出 iMsg 的 With 外面就可以了

ex.  iMsg.Bodypart.Charset = “UTF-8”  ‘(中文要用 UTF-8 ! )

 

發信的 SMTP 也無法照範例的說明使用 Google SMTP Server, 會回應 沒有下 STARTTLS 的錯誤。

上網找了幾個免費的 SMTP Server 但是都有一些限制發廣告信的機制,以下兩個是測通過的。

另外一個是 AMAZON 的 AWS

他的限制比較多,主要就是預設只能寄信給認證過的網域或是郵件信箱,要離開沙盒 就要另外申請。



每月可發封數

每月流量限制

每小時限制最高封數

每24小時可發封數

最大發信頻率


sendpulse.com

12000

 1 TB 

50

---

---


aws.amazon.com

---

---

---

200

每秒 1 封

WordPress Pricing Table Plugin

以下是範例程式碼:

Call Util_DEBUG_SendMailEx("中文測試")

//2016.07.05
//Workable email Function
//Create by Chris
Function Util_DEBUG_SendMailEx(seMailBody)

    Dim iCfg
    Dim iMsg 
    Set iCfg = CreateObject("CDO.Configuration")
    Set iMsg = CreateObject("CDO.Message")

    With iCfg.Fields
        '.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTP SERVER "
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "寄件帳號"
        .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "密碼"
        .Item("http://schemas.microsoft.com/cdo/configuration/sendemailaddress") = "寄件者信箱"
        .Update
    End With
	
	//設定中文內容
	iMsg.Bodypart.Charset = "UTF-8"

    With iMsg
        .Configuration = iCfg
        '按鍵精靈 bug
        '============================
        '.To = "user@domain.com"
        '.Bodypart.Charset = "UTF-8"
        '.HTMLBodypart.Charset = "unicode"
        '============================
        .CC = "收件者信鄉"
        .Subject = "主旨"
        .TextBody = seMailBody
        .AddAttachment "附件檔案位置"
        '.AddAttachment  "可夾帶多個附件"
        .Send
    End With

    Util_DEBUG_SendMailEx = True
    '如果沒有任何錯誤信息,則表示發送成功,否則發送失敗 
    If Err Then 
        TracePrint Err
        Err.Clear 
        Util_DEBUG_SendMailEx = False 
    End If 

    Set iMsg = Nothing
    Set iCfg = Nothing

End Function 
Call Util_DEBUG_SendMailEx("中文測試")

//2016.07.05
//Workable email Function
//Create by Chris
Function Util_DEBUG_SendMailEx(seMailBody)

    Dim iCfg
    Dim iMsg 
    Set iCfg = CreateObject("CDO.Configuration")
    Set iMsg = CreateObject("CDO.Message")

    With iCfg.Fields
        '.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTP SERVER "
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "寄件帳號"
        .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "密碼"
        .Item("http://schemas.microsoft.com/cdo/configuration/sendemailaddress") = "寄件者信箱"
        .Update
    End With
	
	//設定中文內容
	iMsg.Bodypart.Charset = "UTF-8"

    With iMsg
        .Configuration = iCfg
        '按鍵精靈 bug
        '============================
        '.To = "user@domain.com"
        '.Bodypart.Charset = "UTF-8"
        '.HTMLBodypart.Charset = "unicode"
        '============================
        .CC = "收件者信鄉"
        .Subject = "主旨"
        .TextBody = seMailBody
        .AddAttachment "附件檔案位置"
        '.AddAttachment  "可夾帶多個附件"
        .Send
    End With

    Util_DEBUG_SendMailEx = True
    '如果沒有任何錯誤信息,則表示發送成功,否則發送失敗 
    If Err Then 
        TracePrint Err
        Err.Clear 
        Util_DEBUG_SendMailEx = False 
    End If 

    Set iMsg = Nothing
    Set iCfg = Nothing

End Function 
email func

Posts navigation

VEGA Hunter Develop log →
  • 近期文章

    • windows 10 網路分享不用密碼的設定
    • 笑話
    • 右鍵增加 命令提示字元
    • BTC,ETH可以開始做空了!
    • 使用 ssh (console) 重設 wordpress 密碼
  • 近期留言

    • 彙整

      • 2022 年 2 月
      • 2022 年 1 月
      • 2021 年 9 月
      • 2021 年 7 月
      • 2021 年 4 月
      • 2020 年 10 月
      • 2020 年 9 月
      • 2020 年 8 月
      • 2020 年 6 月
      • 2020 年 5 月
      • 2020 年 4 月
      • 2020 年 3 月
      • 2019 年 4 月
      • 2018 年 10 月
      • 2018 年 8 月
      • 2018 年 3 月
      • 2018 年 1 月
      • 2017 年 10 月
      • 2017 年 9 月
      • 2017 年 7 月
      • 2017 年 2 月
      • 2017 年 1 月
      • 2016 年 12 月
      • 2016 年 8 月
      • 2016 年 7 月
    • 分類

      • Design
      • GAME
      • IT
      • Line Rangers
      • MicroStock
      • Photo
      • Pokemon Go
      • Programming
      • Tools
      • Utility
      • VEGA CONFLICT
      • 未分類
    • 其他操作

      • 登入
      • 訂閱網站內容的資訊提供
      • 訂閱留言的資訊提供
      • WordPress.org 台灣繁體中文
    Proudly powered by WordPress Theme: Parament by Automattic.