How to send e-mails via SMTP with PHPmailer and Gmail?
Introduction
Lately, we’re receiving a lot of support questions regarding the use of Gmail SMTP on the free hosting plan. With Gmail SMTP you can send mails from your website without using the default PHP Sendmail. You can use it for your forums, online contact forms etc… In this tutorial, we will explain you the benefits of using Gmail SMTP and give you a tutorial how you can use it in your PHP pages hosted at XtreemHost!
Why using Gmail for sending mail messages?
First of all it’s FREE! Sure most website owners can use their own SMTP server for sending email messages from their website, but it makes sense even than to use Gmail for sending mail. The chance is big that your websites IP address is on a blacklist if your site is on hosted by a shared web hosting provider. If not or you host your site on your own server, there is always a risk that your IP address get blacklisted. Because of some limitations, the SMTP server from Google is a good choice applications with less than 500 recipients a day, check this information from the Google help pages. Furthermore, our free hosting plan meets all requirements to use Google SMTP without problems.
Tutorial: How to setup SMTP for Gmail?
1. If you don’t have one, register a Gmail account or setup your domain for Google applications.
2. Download the most recent version of PHPMailer
3. Extract the PHPMailer packages to a folder named phpmailer and upload that folder to your XtreemHost hosting account (using FTP)
4. Include the phpmailer class file in the page that will send an email. Just include following code in your PHP page: require("class.phpmailer.php");
5. Now, include the below code and edit it with your Gmail account details:
6. Test the page you created and see if the email is sent successfully.
We hope this small tutorial will help everyone that is facing problems with the default PHP Sendmail option that we provide.
How to check whether SMTP port 25 is blocked?
The standard port used for SMTP connections is 25. One of the most common reasons for not being able to send messages is that your Internet service provider blocks this port. This is why using an alternative SMTP port is highly recommended.
Here's how to, depending on your OS, check whether your ISP blocks port 25:
* Check port 25 in Windows
Click on the Start menu button, usually located at the lower left corner of the screen. There is a tab called "Run". Click it and a new window will pop up. In the text field of this window you need to type cmd and then press the "Enter" key. Another window will open. It is the so called "MS-DOS prompt" or "command prompt". Just type the following command in the command prompt window and press "Enter":
telnet my-domain-name.com 25
* Check port 25 in Mac OS
Each Mac OS is delivered with a preinstalled terminal emulator. The terminal is a tool which allows you to execute commands from the command line. Usually, the terminal is located under your Mac HD -> "Applications" directory -> Utilities sub-directory. When the window opens, you will see a command line with a flashing cursor on it so you can start typing right away. Just type the following command and press "Enter":
telnet my-domain-name.com 25
* Check port 25 in Linux
Open your favorite terminal emulator and execute the following command in order to check the connection on port 25 to your website:
telnet my-domain-name.com 25
Results from the 25 port check
If the test is successful, you should receive a message similar to this one:
220-serv01.sitegroundXXX.com ESMTP Exim 4.63 #1 Wed, 18 Apr 2008 07:17:30 -0500
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
If you get a message saying that the connection is refused we recommend that you use the alternative port for your SMTP connection.
What is the alternative SMTP port and how to configure an email client to use it?
The reason why most ISPs block the default SMTP port 25 is because it is used for sending unsolicited emails.
Fortunately, email hosting providers such as SiteGround offer an alternative SMTP port for the convenience of their customers.
The alternative SMTP port all SiteGround customers can use is 2525.
Information on how to change the SMTP port for the most popular mail clients can be found in our Email tutorial.
If you wish to be able to use an alternative SMTP port, as well as have unlimited mail accounts and stable mail service, you may sign up for an account at SiteGround. Our servers are using state of the art spam protection system with custom ACL filters which will ensure you will avoid the spam and at the same time never miss your important emails.
How to use Google's free SMTP server?
Google's GMail offers a free SMTP server which can be used by anyone who has a GMail account.
If you don't have a GMail account, you can create one at the GMail account creation page.
Then all you need to do is configure your mail client to use GMail for outgoing mail server. The details you should use are:
* Outgoing Mail (SMTP) Server: smtp.gmail.com
* Use Authentication: Yes
* Use Secure Connection: Yes (this can be TLS or SSL depending on your mail client)
* Username: your GMail account
* Password: your GMail password
* Port: 465 or 587
SMTP Account Setup How-To
After your application has been approved and an account has been set up, please follow the steps below to configure your account so you can start using the UAS CiviSMTP Service.
NOTE: according to CiviSMTP Terms of Service you are responsible for maintaining a working SOAP Proxy URL that is part of your CiviCRM installation and for making sure it is correctly configured within your CiviSMTP Settings. If at any point during processing of the responses from your constituents the SOAP Proxy URL configured within the CiviSMTP Settings is not reachable or doesn't work as it is supposed to (i.e. returns errors) all responses will be deferred, you will be notified of the problem and further mailings from you will be blocked until you fix the problems with the SOAP Proxy URL. Once you have resolved the problem and notified us that it has been resolved all deferred responses from your constituents will be reprocessed and you will be able to continue sending more mailings using our service.
1. Fill out the SMTP Account settings here:
https://civismtp.uas.coop/civismtp/account
The page at the link above will also test the settings so that you will know when you are configured correctly to use the UAS CiviSMTP.
The page at the above link is only accessible by those that have a current account.
Each field in the form is described below:
* Name for this smtp domain account: - This is the display name for your smtp domain account. The name that you provide in this field will be used only for display in the "Choose the account that you would like to modify:" dropdown on this form.
* User Name for SMTP Authorization - This is the username that is used when email are being sent. This setting should be the same as the value in your CiviCRM SMTP settings - see step #7 below. We will be requiring a username and password when sending emails so that we can prevent the possibility of our relay being used for unsavory purposes.
* Password for SMTP Authorization - The password that is used in conjunction with the smtp username described above. This setting should be the same as the value in your CiviCRM SMTP settings - see step #7 below. We will be requiring a username and password when sending emails so that we can prevent the possibility of our relay being used for unsavory purposes.
* IP Address of the machine from which you will be sending email - This is normally the ip address of the machine where your civicrm installation is located. We need this because we will be checking ip addresses of all senders wehn email is going through our system
* Username of the Civimail Soap User - This is the username of the user in your CiviCRM installation with which our SMTP service communicates messages related to subscribes unsubscribes, etc. You will need to create this user in your civicrm system. How to create this user is detailed below.
* Password for the CiviMail Soap User - This is the username of the user in your CiviCRM installation with which our SMTP service communicates messages related to subscribes unsubscribes, etc. You will need to create this user in your civicrm system. How to create this user is detailed below.
* CiviMail SOAP Proxy - The proxy URL for the CiviCRM Soap Server. The CiviCRM Soap Server is simply a script that comes with CiviCRM and can be accessed via the web after you have successfully installed and activated CiviCRM and CiviMail. This is the URL that we will be contacting about subscribes, unsubscribes, replies, bounce, etc.
Typically, the URL is of the following form but it can be different depending on your installation and version:
DRUPAL - http:///sites/all/modules/civicrm/extern/soap.php
JOOMLA - http:///administrator/components/com_civicrm/civicrm/extern/soap.php
We need to know that url because we use it to contact your CiviMail to tell it about the subscribes unsubscribes, replies, bounce, etc.
* The email domain. - If your domain is example.com you could choose newsletter.example.com. The domain that is chosen is up to you. This is the domain that will be receiving all of the subscribe unsubscribe, replies, etc to your newsletters - it has to be configured in your CiviCRM, see steps #4-6 below. You will also be using this domain when you set up your MX records - see step #3 below.
2. Set up a user in your civicrm installation that has permissions to affect group membership. This is the user with which our system communicates about subscribes, unsubscribes, replies, etc. The user should be totally unprivileged except for a few permissions. The user you create will need the following permissions for the CIVICRM module:
* access CiviCRM
3. Next you will need to add or modify your MX records so that the email domain that you chose for your newsletter will resolve to our email servers. The email servers that we are using are at the following addresses where civismtp is the main server and 2 and 3 are backups respectively:
* civismtp.uas.coop
* civismtp2.uas.coop
* civismtp3.uas.coop
Example MX entries follow assuming that the desired domain is newsletter.example.com
newsletter.example.com. IN MX 5 civismtp.uas.coop.
newsletter.example.com. IN MX 10 civismtp2.uas.coop.
newsletter.example.com. IN MX 10 civismtp3.uas.coop.
After you confirmed that the settings are all correct then you will need to configure your CCRM installation
4. Domain Information
5. go to Administer CiviCRM -> Configure -> Domain Information
6. in the Domain Information block
* Domain Name - the name of the domain of your installation. this is used internally by ccrm to identify separate domains within a single installation
* Description - just a description of this domain
* FROM Name and Email - The FROM Name and Email Address are used when automated emails are sent from this domain (e.g. subscribe and unsubscribe confirmations...). This Name and Email Address are also used as the default 'sender' values when you create a new CiviMail Mailing.
CiviCRM versions prior to 2.2
* Email Domain - The domain you used for configuring your MX records, for example newsletter.example.com
* Save the Domain Information settings
CiviCRM 2.2+
* Save the Domain Information settings
* Go to "Administer CiviCRM" -> CiviMail -> Mail Accounts
* Edit the default account and set the following values only
* Name - whatever name you wish to give to this account
* Email Domain - The domain you used for configuring your MX records, for example newsletter.example.com
* Protocol - choose any value
* Default Option? - yes - select the checkbox and click "Save"
7. go to Administer CiviCRM -> Global Settings -> Outbound Email (SMTP) on CiviCRM 2 and earlier OR Outbound Email (SMTP/SendMail) on CiviCRM 2.1+
* on CiviCRM 2.1+ select "SMTP" in the "Select Mailer" options
* SMTP Server - civismtp.uas.coop
* SMTP Port - we will be running on port 20095, so use 20095
* Authentication? - choose yes
* SMTP username - whatever you configured in the setting in your SMTP account on the CiviSMTP site
* SMTP password - whatever you configured in the setting in your SMTP account on the CiviSMTP site. NOTE: if you do not see "SMTP Password" field on the Outbound Email (SMTP) Settings page then you have to set this value in the civicrm.settings.php file. If you do see the "SMTP Password" on the Outbound Email (SMTP) Settings page still check the civicrm.settings.php file and if the password setting is there then set it.
Installing Drupal on WinHost servers
I tested two versions of Drupal, one is version 7 and the other is version 6.19. Technically Drupal version 7 will install on our server but it is not fully compatible. The reason being is that Drupal uses the mail() function just like WordPress to send out email. The mail() funciton is set to look for the web servers local smtp service to relay out email. This will fail because the web servers smtp service has been disabled. A web application will have to specify the same SMTP server your email client will use (i.e mail.mydomain.com) and also past the SMTP authentication. To get Drupal to use SMTP authentication you will need to download the addon module from its site and install it with your Drupal application. Currently at this time, the SMTP module is not compatible with Drupal version 7 and it is only compatible with Drupal version 6. Therefore, the only version that is truly compatible with our system is Drupal version 6.
Navigate to the Drupal website and download the Drupal application to your personal computer.
http://drupal.org/project/drupal
At this time it is also recommended that you setup the MySQL database in your WinHost control panel. You will need to know MySQL server name, database name, MySQL DB login, and the MySQL DB password.
Installation Instructions
1. Download and uncompress Drupal on your local machine.
2. Navigate to the folder Sites/Default. Inside that folder you will see default.settings.php. Copy that file and save it on the same folder with the name settings.php. Although the contents inside it are the same, Drupal will need both of these files when it runs its installation procedure.
3. Navigate to the folder Sites/All. Create a folder named Modules. This will hold the SMTP module that will help Drupal use SMTP authentication.
4. Create a web.config file within root level of the Drupal application. I have attached to this thread the elements that will have to be in this web.config file. If you already have a web.config file setup, you will need to make sure you create and integrate the elements into existing web.config file. This can prove to be tricky; hence I suggest you upload Drupal as its own application. If you do not want to load Drupal on the root, you can upload it to a subfolder. Bear in mind that the web.config file still have to exist in the Drupal application. To get the latest copy of the web.config file for Drupal refer to this link.
5. Once the file is uploaded call on your Drupal application from the browser. As an example and assuming you uploaded Drupal on your root you will use http://myAccountsDomainName.com
6. Follow the instructions to install Drupal.
7. The Database Configuration screen will prompt you to input your database information. Input your Database Name, the db login and password. Click on the Advanced Options link and type the MySQL server name. The Database port number can be left blank. It will default to the MySQL port of 3306. I suggest you define the table prefix. This will help avoid any future conflicts.
8. On the Configure Site you will input all the necessary fields. This is not server specific you can define input the fields' base on your own requirements.
9. On the last page when you have completed the installation, you will get an error that states that the mail() function does not work. You can ignore this for now and you will need to install the SMTP module so that your Drupal application can send out email.
From here you can log into your site and configure some settings. Once you are ready, log out and close your browser and we can go on ahead installing the SMTP module for Drupal.
Installing SMTP Module for Drupal.
1. Download the SMTP module using this link to your local computer. I downloaded the Developement Release version 6.x-1.x
http://drupal.org/project/smtp
2. Next you will need to download the PHPMailer form this link. There are two versions you can download. The newest version is version 5.1, however according to Drupal's documentation the SMTP module only supports version 2.2.1. I tested both and both worked and I ended up using PHPMailer version 5.1.
http://sourceforge.net/projects/phpm...0for%20php5_6/
3. Uncompress the SMTP module on your local computer. Once it is uncompressed navigate to the SMTP folder. Inside create the folder PHPMailer. You will upload the PHPMailer component in this folder.
4. Connect to the web server using FTP. In your Drupal appplication navigate to Sites/All and create the folder Modules. Within the Modules folder create the folder SMTP.
5. Upload all the SMTP module files and folders into the folder Sites/All/Modules/SMTP.
6. Once you uploaded the SMTP module navigate back to the SMTP folder and go into the PHPmailer folder. Upload the PHPMailer components into the folder.
7. Pull up your Drupal applicaton on the browser and log in as the administrator.
8. Go to Administer/Modules. Scroll down to the bottom of the page an you will see the module for SMTP Authentication Support. Check the box to enable it and save the configuration.
9. Go back to the Administer page and scroll down the bottom of the page. You should now see SMTP Authentication Support. When you go into this page, you will see an option to turn On or Off the module. Make sure you set it to 'On' and input all the SMTP server setting. Leave the SMTP backup server blank. Input the full email address for the SMTP authentication and the password to that POP account. Make sure you keep encrypted protocol to 'No'. The SMTP server does not support encrypted connection. If you are using Google's email server then you will set this to 'Yes' since Goolge requires encrypted connection.
10. Save the configuration and you are now done with the Drupal installation.
Drupal has many other features and modules which I have not tested. However, the guidelines provided is the base guidelines to get Drupal installed and sending out email through our SMTP server. The rest of the configuration will be base on your own business needs and requirements.
The Law of the Garbage Truck
We were driving in the right lane when suddenly a black car jumped out of a parking space right in front of us. My taxi driver slammed on his brakes, skidded, and missed the other car by just inches! The driver of the other car whipped his head around and started yelling at us. My taxi driver just smiled and waved at the guy. And I mean, he was really friendly.
So I asked, ‘Why did you just do that? This guy almost ruined your car and sent us to the hospital!’ This is when my taxi driver taught me what I now call, ‘The Law of the Garbage Truck.’
He explained that many people are like garbage trucks. They run around full of garbage, full of frustration, full of anger, and full of disappointment. As their garbage piles up, they need a place to dump it and sometimes they’ll dump it on you. Don’t take it personally. Just smile, wave, wish them well, and move on. Don’t take their garbage and spread it to other people at work, at home, or on the streets.
Hedonisme Elit Politik dan Ruhut Sitompul
Tak ada pelajaran penting apa pun bila diskusi mengarah kepada Amandemen. Karena, jika itu dilakukan, demokrasi kita tumpas terlalu cepat. Jauh lebih elok mengulik isu Ruhut itu dari aspek lain. Semisal dari sisi komunikasi politik (pencitraan politik).
Salah satu pihak yang potensial menjadi korban politik pencitraan kelas tinggi adalah ini: para pelakunya sendiri. Jauh-jauhlah berharap bahwa Ruhut Sitompul adalah salah satu orang yang sadar akan ancaman ini. Mengingat tokoh pemeran Poltak ini hanya tahu satu hal: hedonisme politik!
Hedonisme adalah praktek bersenang-senang secara liar tanpa peduli nasib orang lain. Filsafat hedonisme tak kenal baik dan buruk kecuali mencandu kepuasan sedalam-dalamnya. Sementara hedonisme politik adalah praktek menguras habis, memanfaatkan, memanipulasi, dan mencampakkan kepatutan, hanya demi mencapai ekstase (kesenangan) tanpa batas. Dan, politisi Partai Demokrat yang kerap berulah minor ini secara sempurna menjadi politisi hedonis, baik dalam perilaku, gaya hidup, maupun kejahatan politik sekaligus.
Apa yang Dilakukan Ruhut?
Ia menguras habis kebencian publik dan antipati terhadap arogansinya justru untuk kesenangan pribadi --dan mungkin juga dinikmati beberapa kolega dekatnya. Tokoh Poltak dalam tayangan Sinetron Teleivisi ini selalu sukses menghisap energi negatif masyarakat (rasa jengkel, muak, enek), untuk kemudian dipermain-mainkan sekehendak hati. Misalnya diarahkan untuk mengalihkan perhatian. Misalnya diarahkan untuk mengabaikan sesuatu yang jauh lebih penting dicerca atau dicaci publik. Tetapi, yang paling keji, Ruhut menghisap energi negatif masyarakat untuk kemudian ia muntahkan ke lawan-lawan politiknya.
Tetapi, jauh lebih menggilas nalar sehat kita adalah bahwa "tokoh" Ruhut ini kemudian menjadi peliharaan penguasa. Ia sungguh bermanfaat demi menyempurnakan agenda pencitraan para penguasa. Ruhut kerap menjadi "the trigger" --pelatuk isu yang kemudian dibungkus dengan jawaban-jawaban plastis (sangat lentur dan plin-plan). Ruhut juga enjoy melakukan "test the water", menguji suasana dan mood politik bangsa ini. Ruhut, terkadang juga berposisi sebagai "the ice breaker", pemecah kebekuan politik yang kadang muncul.
Tak mungkin penguasa besar dan partai besar diam bila tak menangguk untung dari kadernya ini. Sekurangnya, mereka merasa perlu memiliki orang-orang seperti Ruhut. Terlebih poros politik bangsa ini lebih sering bergolak dengan mengandalkan "okol" daripada "akal".
Bagian awal artikel ini menyebut bahwa setiap orang berpeluang menjadi korban atas politik pencitraan yang dimainkan. Dalam tafsiran matematika politik gaya Ruhut adalah surplus untuk (partai) pengausa. Tetapi, dalam tafsiran rasionalitas politik gaya Ruhut menyimpan sejumlah risiko.
Pertama, Ruhut berada dalam perahu besar yang selalu mulus melenggang. Mereka nyaris tak ada lawan seimbang. Ini menggiring pihak-pihak itu menjadi "gigantis". Menjadi merasa besar, tambun, dan hilang kreativitas --jangan tanya soal sensitivitas, partai besar ini bahkan tak pernah bicara soal teror tabung gas!
Kedua, Ruhut dan perahu besarnya (termasuk Pak Nahkoda yang selalu dicitrakan bijaksana), karena terlalu senang dengan rangkaian kemenangan, "digilai" jutaan fans, mereka menjadi narsis! Ingat, perilaku narsis bukan hanya senang dengan "ketampanan" diri sendiri, melainkan juga senang "menyakiti para pecintanya". Sama persis dengan legenda Narcisus yang dikutuk oleh pemujanya --yang bernama Echo. Konon, Dewi Echo yang mengejar-ngejar Narcisus menjadi dendam karena selalu diabaikan.
Dua penyakit ini, narsis dan gigantis, yang kelak akan dinikmati para penguasa dan partai penguasa yang terlanjur mabuk pencitraan. Mereka menjadi tak bisa melihat sebuah proses yang normal dan dinamik. Segalanya harus by setting dan by design.
Lawan politik, kritik politik, dan musuh politik dipersilahkan hadir. Asalkan melalui rekayasa pencitraan. Akhirnya, yang muncul adalah seolah-olah lawan politik, seolah-olah kritik politik, padahal semuanya semu.
Terakhir, perilaku Ruhut diam-diam mengirimkan pesan tentang segara matinya gagasan politik orisinal di negeri ini.
Gagasan mengamandemen konstitusi, seperti disampaikannya, seharusnya bisa berlangsung wajar dan orisinal --jika saja disampaikan oleh orang lain. Tetapi, di tangan Ruhut, gagasan ini mati, karena orang terlanjur apriori. Publik terlanjur jengah. Gagasan Ruhut bukan orisinal, tidak cerdas, dan manipulatif. Inilah yang kemudian membuat banyak pihak meradang.
Semua yang diperlihatkan Ruhut dan para elit penguasa republik ini adalah hedonisme politik tanpa batas. Mereka bersenang-senang di atas kemarahan rakyat. Mereka tanpa henti mempermainkan opini, persepsi, dan memori publik. Akal sehat dicampakkan. Tugas kita, tentu saja, menjaga agar rasio tetap jernih. Itu saja.
Endi Biaro
Balaraja Tangerang Banten
rendi_biaro@yahoo.co.id
02191931667
Sumber : http://suarapembaca.detik.com/read/2010/08/25/175927/1427939/471/hedonisme-elit-politik-dan-ruhut-sitompul