Showing posts with label wamp server. Show all posts
Showing posts with label wamp server. Show all posts

Wednesday, August 10, 2011

Send Email using WAMP Server

This article is also available at http://blog.techwheels.net/send-email-using-wamp-server/. Please visit it for the latest updates on this article.

When building professional web applications, it is very necessary to test email functionality before deploying the website. It is therefore a requirement for web developers to send emails from their development machine during development process.

Solution
After tweaking with the Apache and PHP's INIs, I succeeded in sending email from my WAMP server.

So, to use PHP Mailer with GMail, ensure the following:
  • IMAP Access is enabled in your GMail's Settings -> Forwarding and POP/IMAP -> IMAP Access:


  • "ssl_module" module in Apache server is enabled:


  • "php_openssl", "php_smtp" and "php_sockets" extensions for PHP compiler are enabled:

I used the following code in PHP file:

require 'class.phpmailer.php';
$mail = new PHPMailer();
$mail->PluginDir = './PHPMailer_5.2.0'; // relative path to the folder where PHPMailer's files are located
$mail->IsSMTP();
$mail->Port = 465;
$mail->Host = 'smtp.gmail.com'; // "ssl://smtp.gmail.com" didn't worked
$mail->IsHTML(true); // if you are going to send HTML formatted emails
$mail->Mailer = 'smtp';
$mail->SMTPSecure = 'ssl';

$mail->SMTPAuth = true;
$mail->Username = "your_gmail_user_name@gmail.com";
$mail->Password = "your_gmail_password";

$mail->SingleTo = true; // if you want to send mail to the users individually so that no recipients can see that who has got the same email.

$mail->From = "your_gmail_user_name@gmail.com";
$mail->FromName = "Your Name";

$mail->addAddress("user.1@yahoo.com","User 1");
$mail->addAddress("user.2@gmail.com","User 2");

$mail->addCC("user.3@ymail.com","User 3");
$mail->addBCC("user.4@in.com","User 4");

$mail->Subject = "Testing PHP Mailer with localhost";
$mail->Body = "Hi,<br /><br />This system is working perfectly.";

if(!$mail->Send())
    echo "Message was not sent <br />PHP Mailer Error: " . $mail->ErrorInfo;
else
    echo "Message has been sent";


To use PHP Mailer on actual online server, you will need to change some of the configurations of PHP Mailer as described on the cPanel like control panel on your actual online server. These configurations would be:
  • $mail->Port
  • $mail->Host
  • $mail->Mailer
  • $mail->SMTPSecure
  • $mail->Username
  • $mail->Password
  • $mail->From
  • $mail->FromName

Monday, August 8, 2011

Exception in module wampmanager.exe at 000F15A0


I was using Windows 7 64-bit OS.  Because of some hardware problem, I had to reinstall the OS. I had then Windows 7 32-bit OS DVD so I decided to test and install 32-bit version. I was using the WAMP Server version 2.1d x64 and it was installed on D: drive and therefore it was safe when I formatted the Windows 7 64-bit. I had previously several times formatted and used the old same WAMP installation without re-installing WAMP server in the freshly installed OS; it was working fine.

But after installing Windows 7 32-bit, time I was receiving this error message:


Problem signature:
  Problem Event Name:          APPCRASH
  Application Name:            wampmanager.exe
  Application Version:         1.6.1.33
  Application Timestamp:       2a425e19
  Fault Module Name:           KERNELBASE.dll
  Fault Module Version:        6.1.7600.16385
  Fault Module Timestamp:      4a5bdaae
  Exception Code:              0eedfade
  Exception Offset:            00009617
  OS Version:                  6.1.7600.2.0.0.256.1
  Locale ID:                   1033
  Additional Information 1:    891f
  Additional Information 2:    891f8ecaa4636eab9d64e12e7ca2b7c4
  Additional Information 3:    fd5c
  Additional Information 4:    fd5c21723f3b200d9ca391af2a52aa45

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt

After choosing the "Close the program" button from the dialog box, another message box was displayed:


Application Error
Exception Exception in module wampmanager.exe at 000F15A0.
Could not execute run action:
.

So, I think this happens because I had previously downloaded and installed the 64-bit version of WAMP Server for my Windows 7 64-bit and now I have installed it on Windows 7 32-bit.



Solution
  1. Install the 64-bit Windows OS and keep the WAMP Server's 64-bit installation as it is. --OR--
  2. Install the 32-bit version of WAMP Server on the current Windows 32-bit OS.