A Paubox subscription or trial subscription is required (don't have one? sign up here!)
Questions? Stuck? We’re here for you! support@paubox.com
Here's how to send email via the SMTP Server Solution with nodemailer
var nodemailer = require("nodemailer"); var smtpTransport = require("nodemailer-smtp-transport"); var transporter = nodemailer.createTransport(smtpTransport({ "port": 587, "host": "api.paubox.com", "auth": { "user": "user@api.paubox.com", "pass": "password" }, "tls": { "rejectUnauthorized": false } })); transporter.sendMail({ from: "from@server.com", to: "to@server.com", subject: "Subject", html: "html body", text: "text body" // etc }, function (err) { // error handling });
Here's how to send email via the SMTP Server Solution with Ruby on Rails Action Mailer
config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "api.paubox.com", :port => 587, :user_name => "user@api.paubox.com", :password => "<password>", :enable_starttls_auto => true, :authentication => "plain", }
Here's how to send email via the SMTP Server Solution with PHP
<?php require_once "Mail.php"; // SMTP authentication params $smtp_params["host"] = "api.paubox.com"; $smtp_params["port"] = "587"; $smtp_params["auth"] = true; $smtp_params["username"] = "user@api.paubox.com"; $smtp_params["password"] = "<password>"; ?>
Here's how to send email via the SMTP Server Solution with C#
MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("api.paubox.com"); mail.From = new MailAddress("your_email_address"); mail.To.Add("recipient_email_address"); mail.Subject = "Test Mail"; mail.Body = "Hello World"; SmtpServer.Port = 25; SmtpServer.Credentials = new System.Net.NetworkCredential("user@api.paubox.com", "<password>"); SmtpServer.EnableSsl = true; SmtpServer.Send(mail); MessageBox.Show("mail Send");
Here's how to send email via the SMTP Server Solution with Python
#!/usr/bin/python import smtplib USERNAME = "user@api.paubox.com" PASSWORD = "password" FROM = USERNAME TO = ["recipient@example.com"] SUBJECT = "subject" TEXT = "text body" message = """From: %s\nTo: %s\nSubject: %s\n\n%s""" % (FROM, ", ".join(TO), SUBJECT, TEXT) server = smtplib.SMTP("api.paubox.com", 587) server.ehlo() server.starttls() server.login(USERNAME, PASSWORD) server.sendmail(FROM, TO, message) server.close()
Comments
0 comments
Article is closed for comments.