我正在使用兩個文件通過Mailgun發送消息。它們是:無法使用紅寶石發送帶有Mailgun的多行純文本電子郵件
email_sender.rb
message_text.rb
的第一個代碼是:
require './message_text.rb'
fromLabel = "Email Guy"
fromAddress = "[email protected]*****.com"
toAddress = "[email protected]*****.net"
subject = "An Invitation"
cmd = "curl -s --user 'api:key-*****' https://api.mailgun.net/v3/mail.*****.com/messages -F from='" + fromLabel + " <" + fromAddress + ">' -F to='" +toAddress + "' -F subject='" + subject + "' -F text='" + $message + "'"
wasGood = system (cmd)
第二個文件中的代碼是:
$message = "Line One Text."
+ "\n" + "\n" + "And Line Two Text!"
當我測試發送電子郵件時,該消息到達我的測試帳戶收件箱如下。
Line One Text.