Store email and username in mysql database using php

<?php //opens connnection to mysql server   $dbc = mysql_connect(’localhost’,’root’,”); if (!dbc){ die(’Not Connected:’ . mysql_error()); } //select a database   $db_selected = mysql_select_db("rivals",$dbc); if(!$db_selected) { die("can’t connect :" . mysql_error()); }   $query = "UPDATE `database` SET email=’something’ WHERE username=’rivals’"; $result = mysql_query($query, $dbc) or die(mysql_error());   $username = $_GET[’username’]; $email = $_GET[’email’]; $password […]
Continue reading…

Enjoyed this post? Share it!

 
 

imap_last_error() function in PHP

This function returns the full text of the last IMAP error message that occurred on the current page. Returns FALSE if no error messages are available. It is useful in connecting to an IMAP server as shown. $mailbox = "{mail.myhost.com:143}INBOX"; $user = "me@myhost.com"; $pass = "mypassword";   $connection = imap_open($mailbox,$user,$pass) or die(imap_last_error()."<br>Connection Faliure!");
Continue reading…

Enjoyed this post? Share it!

 
 

Open a stream to an IMAP mailbox in PHP

Developers can use the imap_open() php function, which enables you to open a stream to a IMAP server. Example to open a connection to an IMAP server: // To connect to an IMAP server running on port 143 on the server.com machine <?php $imaphandle = imap_open("{servername.com:143}INBOX", $user, $pass); ?> The first argument is the mailbox […]
Continue reading…

Enjoyed this post? Share it!

 
 

Send email with CC(Carbon Copy) & BCC(Blind Carbon Copy)

The Windows implementation of mail() differs in many ways from the Unix implementation. First, it doesn’t use a local binary for composing messages but only operates on direct sockets which means a MTA is needed listening on a network socket (which can either on the localhost or a remote machine). Second, the custom headers like […]
Continue reading…

Enjoyed this post? Share it!

 
 

Simple email with php

Create a HTML Form that Accepts Mail-Related Information. The form must post to a php file and mail() function should be enabled on the server to complete sending email. Save as sendmail.html <html> <head> <title>Simple Send Mail Form w3mentor.com</title> </head> <body> <h1>Mail Form</h1> <form name="form1" method="post" action="mail.php"> <table> <tr><td><b>To</b></td><td><input type="text" name="mailto" size="35"></td></tr> <tr><td><b>Subject</b></td> <td><input type="text" […]
Continue reading…

Enjoyed this post? Share it!