Absolutely Tech

[HowTo] Use mutt with msmtp

Mutt is a small but very powerful text-based mail client for Unix operating systems. Msmtp is a smtp client which is available for Linux as well as windows.
Configuring mutt to work with msmtp is fortunately quite easy. Here’s a tutorial teaching the same.
Step 1:
Find the executable path of msmtp:

which msmtp

Step 2:
Just open ~/.muttrc using a text editor and add the following code to it:

send2-hook '~f fromaddress@example.com' 'set sendmail="PATH"'

Replace PATH with the executable path of msmtp and replace fromaddress@example.com to the FROM address you want in your email address to appear. For me the code looks like the following (on Ubuntu 10.10):

send2-hook '~f dpac.mittal2@gmail.cm' 'set sendmail="/usr/bin/msmtp"'

Try sending a mail with mutt and it should succeed.

Cheers!

[HOWTO] Send emails(using mail function) from localhost in PHP through msmtp (using gmail account) on Linux

There’ve been lots of times when I wanted to use the mail() function on my local server. I am sure lots of you would’ve been wanting it too but most of you would’ve settled for PHPMailer or just used a web host to test the code instead. I myself had been doing the same until recently when I finally decided to do some research and get it to work.

Here are the steps in short for the geeks who like to do things on their own:
All I did was used smtp client called msmtp, configured it to work with my gmail account and configured PHP to use msmtp to send emails.

This tutorial is only applicable for linux users. I’ll write another article for windows users soon when I get my hands on a windows box.
All the commands used in the instructions are for Ubuntu, however you may use corresponding commands for your distro (for eg; you can use yum install instead of apt-get install on fedora, redhat, centos.

Step by step instructions:

Read the rest of this entry »

Using CodeIgniter’s Email library separately

I’ve developed my own libraries for rapid development of PHP applications. Email library is one area which I didn’t feel like developing a library for. Just then, I remembered how simple and robust CodeIgniter’s Email class was. I decided to try it on my own script. It was not at all difficult to get it working. It just commented out few lines of codes and voila! I was able to send my first email.

Those who are in need of a email library could use this simple library separately. I’ll guide you through the whole process step by step.

First thing you need to do is copy the Email.php from system/libraries folder and place it inside your script. Then use your favorite IDE to edit these lines:
Read the rest of this entry »