Saturday, March 29, 2014

Send email from localhost/WAMP/xampp Server

If you want to send mail from your localhost/PC then here is the solution

1. First of all you need to install WAMP/XAMPP server.
2. Download this send mail Download the sendmail.zip  which is only 1.08 MB file.
3.Unzip the file and keep all files in a folder name sendmail in in “C:\wamp\”. so it'll looks like in “C:\wamp\sendmail”.
[For xampp sendmail already exist]
4. Open the “sendmail.ini” file and configure it as following
  • smtp_server=smtp.gmail.com
  • smtp_port=465
  • smtp_ssl=ssl
  • default_domain=localhost
  • error_logfile=error.log
  • debug_logfile=debug.log
  • auth_username=[your_gmail_account_username]@gmail.com
  • auth_password=[your_gmail_account_password]
  • pop3_server=
  • pop3_username=
  • pop3_password=
  • force_sender=
  • force_recipient=
  • hostname=localhost
Note  "You do not need to specify any value for these properties: pop3_server, pop3_username, pop3_password, force_sender, force_recipient. The error_logfile and debug_logfile settings should be kept blank if you have already sent successful email(s) otherwise size of this file will keep increasing. Enable these log file settings if you don’t get able to send email using sendmail."

5. Enable IMAP Access in your GMail’s Settings -> Forwarding and POP/IMAP -> IMAP Access:
6. Enable “ssl_module” module in Apache server: for XAMPP click configure from xampp control and open php.ini file and uncomment php_openssl extensions .
 7. Enable “php_openssl” and “php_sockets” extensions for PHP compiler:

8 Open php.ini from “C:\wamp\bin\apache\Apache2.2.17\bin” and configure it as following (The php.ini at “C:\wamp\bin\php\php5.3.x” would not work) (You just need to configure the last line in the following code, prefix semicolon (;) against other lines):

[For  XAMPP click configure from xampp control and open php.ini  ]

[mail function]
; For Win32 only.
; http://php.net/smtp
;SMTP = 
; http://php.net/smtp-port
;smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = you@domain.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "C:\wamp\sendmail\sendmail.exe -t -i"
[ for XAMPP sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t" ]
 
9 . Restart WAMP Server.
10. Create a PHP file and write the following code in it: 
11. <?php
$to       = 'recipient@yahoo.com';
$email="sender@gmail.com"; // from email address
$subject  = 'Testing sendmail.exe';
$message  = 'Hi, you just received an email using sendmail!';
$headers  = 'From: sender@gmail.com' . "\r\n" .
            'Reply-To: sender@gmail.com' . "\r\n" .
            'MIME-Version: 1.0' . "\r\n" .
            'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
            'X-Mailer: PHP/' . phpversion();
 
if(mail($to, $subject, $message, $headers))
    echo "Email sent";
else
    echo "Email sending failed";
?> 


Open this file in browser,now it should work
If it shows "Cannot Send Email"  please refresh the page..It'll work
Thanks

 

Tuesday, March 11, 2014

Installing Joomla 3.2 hangs on

I am trying to install fresh new joomla 3.2 site but when it start installing database ,the installation hang on and the installation process would not finish.
Here is the solution which one solve my problem.I hope this could be also helpful to other.

Do as following instructions

1. Open   SQL installation  file (Root/installation/SQL/mysql/joomla.sql)
2. Use a code editor like notepad++
3.  Replace all  "ENGINE=InnoDB" with "ENGINE=MyIsam"

Now try to install again and hope now this time will work.

Thanks

Monday, March 10, 2014

Highlight php mysqli syntax in notepad++


Most of web developer use notepad++ for coding.It's very easy to use, super fast and free code editor.
I'm also using notepad++.As you know php is not supporting myslq function and this extension is deprecated as of PHP 5.5.0, and is not recommended for writing new code as it will be removed in the future. Either the mysqli or PDO_MySQL extension should be used.
But mysqli is not highlighting in notepad++..Here is the solution for you
  1. open note pad select settings
  2. select style configurator
  3. in language select php
  4. in style select WORD
  5. in user-defined key words enter the keyword you want highlighted.
    make sure there is a space after false (first item.)
    Below is a list (It's the ones I use.)
  6. Save and close.
True false
mysqli_affected_rows
mysqli_autocommit
mysqli_change_user
mysqli_character_set_name
mysqli_close
mysqli_commit
mysqli_connect_errno
mysqli_connect_error
mysqli_connect
mysqli_data_seek
mysqli_debug
mysqli_dump_debug_info
mysqli_errno
mysqli_error_list
mysqli_error
mysqli_fetch_all
mysqli_fetch_array
mysqli_fetch_assoc
mysqli_fetch_field_direct
mysqli_fetch_field
mysqli_fetch_fields
mysqli_fetch_lengths
mysqli_fetch_object
mysqli_fetch_row
mysqli_field_count
mysqli_field_seek
mysqli_field_tell
mysqli_free_result
mysqli_get_charset
mysqli_get_client_info
mysqli_get_client_stats
mysqli_get_client_version
mysqli_get_connection_stats
mysqli_get_host_info
mysqli_get_proto_info
mysqli_get_server_info
mysqli_get_server_version
mysqli_info
mysqli_init
mysqli_insert_id
mysql_kill
mysqli_more_results
mysqli_multi_query
mysqli_next_result
mysqli_num_fields
mysqli_num_rows
mysqli_options
mysqli_ping
mysqli_prepare
mysqli_query
mysqli_real_connect
mysqli_real_escape_string
mysqli_real_query
mysqli_reap_async_query
mysqli_refresh
mysqli_rollback
mysqli_select_db
mysqli_set_charset
mysqli_set_local_infile_default
mysqli_set_local_infile_handler
mysqli_sqlstate
mysqli_ssl_set
mysqli_stat
mysqli_stmt_init
mysqli_store_result
mysqli_thread_id
mysqli_thread_safe
mysqli_use_result
mysqli_warning_count

This is  same way you can add new keyword or function which you want to highlight in your notepad++.

Thanks

Total Pageviews