Jesin's Blog

Welcome to the Portal of Technology

  • Facebook
  • GitHub
  • RSS
  • Twitter
  • Home
  • Categories
    • Domains
    • Linux
    • Networking
    • PHP
    • Virtualization
    • Web Design
    • Web Servers
    • Windows
  • WordPress Plugins
    • Custom Error Pages
    • HTTP Digest Authentication
    • Mailgun Email Validator
  • Toolbox
    • DNS Lookup Tool
    • htdigest Generator Tool Online
    • htpasswd Generator Tool Online
    • HTTP Headers Lookup Tool
    • MD5 Encryption Tool
    • Open Port Check Tool
    • SHA-1 Encryption Tool
    • URL Encoding/Decoding Tool
  • About Me
  • Contact Me
  • Sitemap
Home ›
php

How to use MSMTP with Gmail, Yahoo and PHP Mail

October 24, 2011 Linux Jesin A 12 Comments

linux category thumbnail

This is a three in one tutorial which combines how to use MSMTP to send mails via Gmail and Yahoo servers and how to use MSMTP with PHP Mail() function instead of the default sendmail.

Installing msmtp

To install msmtp on Red Hat/CentOS/Fedora type of distributions

yum install msmtp

To install msmtp on Debian/Ubuntu type of distributions

apt-get install msmtp

Configuring msmtp with Gmail and Yahoo

Create or edit the msmtp configuration file in the user’s home directory. I use VI editor to achieve this

vi ~/.msmtprc

Add the following lines to the file, it configures msmtp for both Gmail and Yahoo

account yahoo
tls on
tls_starttls off
auth on
host smtp.mail.yahoo.com
user user1
from user1@yahoo.com
password ******
account gmail
tls on
auth on
host smtp.gmail.com
port 587
user user1@gmail.com
from user1@gmail.com
password ******

Since the file contains sensitive data like passwords you should assign secure permissions

chmod 600 ~/.msmtprc

Continue Reading…

Tags: linux, php, php.ini

PHP Open Port Check Script

July 16, 2011 PHP Jesin A 7 Comments

php category thumbnail

A quick tutorial on how to check for open ports using PHP. This function fsockopen() is used in the Open Port Check Tool in this blog. You can check whether a certain port is open on a specified IP address or hostname. Before reading take note that most FREE web hosting providers disable fsockopen() function as a security measure so first check whether the function can be used. Another thing to take note is that if fsockopen is unable to connect to a port it doesn’t necessarily mean that port is closed on the remote host, your server in which the script is running might also have block the OUTBOUND connection to that port.Continue Reading…

Tags: php, php scripts

PHP Pie Chart Script

July 7, 2011 PHP Jesin A 5 Comments

php category thumbnail

A PHP Pie Chart script created by me using which any data and values can be represented using the pie chart. The PHP Pie Chart script is available for free download. By passing a query string you can compare any number of values. What follows is how to use my PHP Pie Chart Script and the code to download. The PHP Pie Chart script uses the following PHP image functions ImageCreate(), ImageColorAllocate(), imagefilledrectangle(), ImageFilledArc(), imagettftext(), ImagePNG() and ImageDestroy(). To edit the code you need to know how to use these functions.Continue Reading…

Tags: php, php scripts

W3 Total Cache Remove Footer

July 4, 2011 PHP Jesin A 10 Comments

remove w3 total cache comment

The W3 Total Cache is a caching plugin for wordpress which improves the performance of your wordpress blog. When this plugin is activated it inserts a HTML comment into your code which looks like this

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching using disk

Served from: www.example.com @ 2011-07-04 06:59:27 -->

If you wish to remove W3 Total Cache Footer follow my instructions.Continue Reading…

Tags: php, wordpress

PHP Sessions Tutorial

March 8, 2011 PHP Jesin A Leave a Comment

php category thumbnail

This PHP sessions tutorial explains how sessions work, commonly used PHP session handling functions and how to use then. A session is the time duration that starts from the time a user visits a website and ends when he/she leaves the website. Usually when we use PHP variables they can be accessed only in the script in which they are used but sessions variables can be accessed by all PHP scripts which are accessed during that “session” Sessions greatly help in personalizing an user’s experience on a website, they can also be used to create Login pages using PHP. We’ll first see how PHP sessions work.Continue Reading…

Tags: php

Checkbox in PHP

February 19, 2011 PHP Jesin A 4 Comments

php category thumbnail

This tutorial explains how to use checkboxes in PHP to get values which are checked by the user. Use checkboxes in PHP and insert the values into MySQL. Usually using other HTML form controls with PHP is easy. The input element is assigned a name and values entered can be retrieved using GET or POST method. But in the case of checkboxes it might be ticked or left empty also. Using checkboxes in PHP involves setting the name attribute of all checkboxes to a common name with an empty square bracket denoting an array. When the form is submitted the vales of the items checked are send as an array which is explained hereContinue Reading…

Tags: php, php in html

  • « Previous Page
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next Page »

Get a wealth of information delivered to your inbox. Subscribe and never miss a single article.

  • Tutorials and howtos
  • Code, scripts and commands
  • Online Tools

* No spam, unsubscribe anytime

Hire Me

  • SSL installation and hardening (A+ on Qualys SSL test)
  • Apache & Nginx configuration
  • Email deliverability improvement (10/10 on Mail Tester & MailGenius)
  • WordPress customization, optimization and migration
  • and much more…

    Tools

    • DNS Lookup Tool
    • htdigest Generator Tool Online
    • htpasswd Generator Tool Online
    • HTTP Headers Lookup Tool
    • MD5 Encryption Tool
    • Open Port Check Tool
    • SHA-1 Encryption Tool
    • URL Encoding/Decoding Tool

    Nav

    • Home
    • About Me
    • Contact Me
    • Privacy Policy
    • Sitemap
    Vultr SSD VPS

    Creative Commons License
    Jesin's Blog by Jesin A is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
    Based on a work at websistent.com.