Basic SMTP Setup
| Server | smtp.critsend.com |
| Port | 25 or 587 |
| Username | [your CritSend username] |
| Password | [your CritSend password] |
| Encryption | Plain Text |
Configuring Sendmail for CritSend's SMTP Relay
/etc/mail/access should include:
AuthInfo:smtp.critsend.com "U:CritSendUsername" "P:CritSendPassword" "M:PLAIN"
yum install sendmail-cf
cd /etc/mail
echo "AuthInfo:smtp.critsend.com \"U:YourCritSendUsername\" \"P:YourCritSendPassword\" \"M:PLAIN\"" > access
makemap hash access.db < access
add the following to /etc/mail/sendmail.mc
define(`SMART_HOST', `smtp.critsend.com')dnl
dnl #FEATURE(`access_db', `hash -T -o /etc/mail/access.db < /etc/mail/access')dnl
FEATURE(`authinfo', `hash /etc/mail/access.db')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
/etc/init.d/sendmail restart
In lists/config/config.php the following lines should look like:
In /lists/admin/class.phplistmailer.php replace the if statement after "$this->Host = PHPMAILERHOST;" with this:
Replace:
Configuring Postfix for CritSend's SMTP Relay
To use CritSend's SMTP relay, your main.cf should include:
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:YourCritSendUsername:YourCritSendPassword
smtp_sasl_security_options = noanonymous
header_size_limit = 4096000
relayhost = [smtp.critsend.com]:25
You may need to install libsasl2-modules
Configuring Exim for CritSend's SMTP Relay
Update /etc/exim4/update-exim4.conf.conf file:
dc_eximconfig_configtype='smarthost'
dc_other_hostnames=''
dc_local_interfaces='127.0.0.1'
dc_readhost='your.server.name'
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.critsend.com::587'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='true'
dc_mailname_in_oh='true'
Set your password and username to be your CritSend username and password:
*:YourCritSendUsername: YourCritSendPassword
For the/etc/exim4/exim4.conf.localmacros (create file if it doesn't already exist):
MAIN_TLS_ENABLE= 1
Make sure you Restart your Exim server afterwards.
How to Send Email in PHP through the CritSend SMTP Relay
Here is the sample PHP code to send SMTP emails. The PHP PEAR mail package must be installed for this to work.
$from, "To" => $to, "Subject" => $subject);
$smtp = Mail::factory("smtp",
array( "host" => $host,
"auth" => true,
"username" => $username,
"password" => $password));
$mail = $smtp->send($to, $headers, $body);
if(PEAR::isError($mail)){
echo($mail->getMessage());
}else{
echo("Message successfully sent!");
}
?>
Sending mail in Ruby on Rails with CritSend's SMTP Relay
Create a file config/initializers/critsend.rb
ActionMailer::Base.smtp_settings = {
:address => "smtp.critsend.com",
:port => 587,
:authentication => :plain,
:user_name => "YOUR_CRITSEND_USERNAME",
:password => "YOUR_CRITSEND_PASSWORD",
:enable_starttls_auto => false
}
ActionMailer::Base.delivery_method = :smtp
Sending mail in .NET with CritSend's SMTP Relay
Using ASP.net you can sent SMTP emails using CritSend.
MailMessage message = new MailMessage();
message.From = new MailAddress("your_email@example.com");
message.To.Add(new MailAddress("recipient1@example.com"));
message.To.Add(new MailAddress("recipient2@example.com"));
message.To.Add(new MailAddress("recipient3@example.com"));
message.Subject = "Subject goes here";
message.Body = "The message goes here";
SmtpClient client = new SmtpClient();
client.Send(message);
System.Net.Mail reads SMTP configuration data out of the web.config file. Here is a way to configure it:
Configuring Python for CritSend's SMTP Relay
This simple python script can be used to send emails via the SMTP relay. The script can be modified to send email addresses to multiple people.import smtplib #your critsend's credentials critsend_user = 'YOUR CRITSEND USERNAME' critsend_password = 'YOUR CRITSEND PASSWORD' sender = "YOUR NAME" recipients = ['RECIPIENT EMAIL'] subject = "My subject" content = """My email message""" message = ("From: %s\r\nTo: %s\r\nSubject: %s\r\n%s" % (sender, ", ".join(recipients), subject, content)) try: server = smtplib.SMTP("smtp.critsend.com", 587) server.ehlo() server.starttls() server.ehlo server.login(critsend_user, critsend_password) server.sendmail(sender, recipients, message) print "Successfully sent email" except SMTPException: print "Error: unable to send email"
Configuring Java for CritSend's SMTP Relay
This java code can be used to send a CritSend SMTP email.
import java.io.*;
import java.net.InetAddress;
import java.util.Properties;
import java.util.Date;
import javax.mail.*;
import javax.mail.internet.*;
import com.sun.mail.smtp.*;
public class Distribution {
public static void main(String args[]) throws Exception {
Properties props = System.getProperties();
props.put("mail.smtps.host","smtp.critsend.com");
props.put("mail.smtps.auth","true");
Session session = Session.getInstance(props, null);
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress("your_email@example.com"));;
msg.setRecipients(Message.RecipientType.TO,
InternetAddress.parse("Recipient_address@example.com", false));
msg.setSubject("Your subject here "+System.currentTimeMillis());
msg.setText("Your content here");
msg.setHeader("X-Mailer", "Header");
msg.setSentDate(new Date());
SMTPTransport t =
(SMTPTransport)session.getTransport("smtps");
t.connect("smtp.critsend.com", "YourCritSendUsername", "YourCritSendPassword");
t.sendMessage(msg, msg.getAllRecipients());
System.out.println("Response: " + t.getLastServerResponse());
t.close();
}
}
Configuring PHP List for CritSend's SMTP Relay
Using PHP List you can setup for mail to be sent to the CritSend SMTP relay. You can setup PHP List for the CritSend SMTP relay by editing the various configuration and administration pages.In lists/config/config.php the following lines should look like:
define ("TEST",0);
define("PHPMAILERHOST",'smtp.critsend.com');
$phpmailer_smtpuser = '';
$phpmailer_smtppassword = '';
$phpmailer_smtpsecure = 'tls';
$phpmailer_smtpport = '25';
In /lists/admin/class.phplistmailer.php replace the if statement after "$this->Host = PHPMAILERHOST;" with this:
$this->Username = $GLOBALS['phpmailer_smtpuser']; $this->Password = $GLOBALS['phpmailer_smtppassword']; $this->SMTPSecure = $GLOBALS['phpmailer_smtpsecure']; $this->Port = $GLOBALS['phpmailer_smtpport'];Finally, In /lists/admin/phpmailer/class.smtp.php:
Replace:
$this->smtp_conn = fsockopen($host, # the host of the serverWith:
$this->smtp_conn = fsockopen($host='tls://smtp.critsend.com',
Configuring Interspire for CritSend's SMTP Relay
Using Interspire Email Marketer you can setup for mail to be sent to the CritSend SMTP relay. You can setup Intersprire for the CritSend SMTP relay by editing the settings page. You must select 'Use SMTP Server'.SMTP Hostname: smtp.critsend.com SMTP Username: CritSend_username SMTP Password: CritSend_password SMTP Port: 25Here is a screenshot of the setup page:
Configuring Sendblaster for CritSend's SMTP Relay
SendBlaster can be configured to use CritSend's SMTP relay. To do so you must be using the SMTP server option, not Direct send. The configuration is as follows:SMTP Hostname: smtp.critsend.com SMTP Username: YourCritSendUsername SMTP Password: YourCritSendPassword SMTP Port: 25
Configuring Expression Engine for CritSend's SMTP Relay
Using Expression Engine you can setup for mail to be sent to the CritSend SMTP relay. You can setup Expression Engine for the CritSend SMTP relay by editing the Admin/Email configuration page. Select SMTP as the email protocol. The three settings are as follows:SMTP Server Address: smtp.critsend.com SMTP Username: YourCritSendUsername SMTP Password: YourCritSendPassword
