Guest User

Untitled

a guest
Dec 10th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. require 'rubygems'
  4. require 'postmark'
  5. require 'tmail'
  6.  
  7. #require './readhtml.rb'
  8.  
  9. Postmark.api_key = "ffabe526-053d-41d1-8489-e5eca52c1f27"
  10.  
  11. message = TMail::Mail.new
  12. message.from = "igor@wildbit.com"
  13. message.to = "b935f619461421d03d1ebd76ec881044+hashcheck@inbound.staging.postmarkapp.com"
  14. #message.cc = "ibalosh+uno@gmail.com"
  15. #message.bcc = "ibalosh+tre@gmail.com, ibalosh+quatro@gmail.com"
  16. message.content_type = "text/html"
  17. message.body = "test send" #read_file("template.html")
  18. message.reply_to = "ibalosh+reply@gmail.com"
  19. message.subject = "check inbound"
  20. #message.body = read_file("svn.html")
  21. message.tag = "inbound"
  22. #message.postmark_attachments = [File.open("svn.html")]
  23. #message["CUSTOM-HEADER"] = "my custom header value"
  24.  
  25.  
  26. # staging setup start
  27.  
  28. Postmark.host = "ec2-184-72-216-101.compute-1.amazonaws.com"
  29. #Postmark.host = "ec2-50-16-85-87.compute-1.amazonaws.com"
  30. #Postmark.path_prefix = "/staging/"
  31.  
  32. # staging setup end
  33.  
  34. for i in 1..1 do
  35.  
  36. # begin
  37.  
  38.  
  39. #puts "message" + i.to_s + " checking it right now"
  40. #message.to = "ibalosh+newtest+#{i.to_s}@gmail.com"
  41. #message.subject = "once more new something checking send " + i.to_s + "test from api slave to live"
  42. #message.body = "test message once more now on slave to live" + i.to_s #read_file("template.html")
  43.  
  44. puts i
  45. p Postmark.send_through_postmark(message)
  46.  
  47.  
  48. # rescue Postmark::InvalidMessageError
  49.  
  50.  
  51. # puts "man"
  52. # end
  53.  
  54. end
Add Comment
Please, Sign In to add comment