Jump to content

Search the Community

Showing results for tags 'php mysql gmail birthday'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi, I need a php script that connect to a mysql database and retrive the current date birthday information and mail through php mail using gmail smtp to about 1500 mail addresses. I have database ready with me name of database in empmaster like Firstname lastname Date of Birth and this php page is going to run everyday and mail if there is birthday today of anyone. Thanks in Advance please help someone. I have one example (not exactly related to my requirement but for only example i tried it but not worked with exammp) found from Internet pls see in attachment. ----------------------------------------------code------------------------------------------------------------------ <?php require_once('connect/test.php'); ?> //This makes the connection to mysql database <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Home Page</title> </head> <body> <h3>Thank you!</h3> <p> <?php require_once("phpMailer/lib/class.phpmailer.php"); require_once("phpMailer/lib/class.smtp.php"); require_once("phpMailer/lib/language/phpmailer.lang-en.php"); $to_name = "sammuel"; $to = "gfgdfgh@gmail.com"; $subject = "A new user has been registered to the website"; $from_name = "John Smith"; $from = "ggffdhfg@gmail.com"; //PHP SMTP version $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "smtp.gmail.com"; $mail->Port =587; $mail->SMTPAuth = false; $mail->Username = "gffdhgdhhhd@dgs.com"; $mail->Password = "password"; $mail->FromName = $from_name; $mail->From = $from; $mail->AddAddress($to, $to_name); $mail->AddAddress("gdhdhdhh@gmail.com"); $mail->IsHTML(true); $mail->Body = "<html><head></head><body><h2>A new user has registered at my website</h2>"; // ======== get database data ================== $link = mysqli_connect("localhost","root","12345"); $database="mydatabase"; mysqli_select_db ($database,$link) OR die ("Could not open $database" ); $query = "SELECT * FROM A WHERE id= 123"; //xyz is id of desired user name. $result1 = mysqli_query($query); // error checking may be required here while ($a_row = mysqli_fetch_array($result1) $mail->Body .= "<p>Name: ". $a_row['name'] . "</p>"; $mail->Body .= "<p>Surname: ". $a_row['surname'] . "</p>"; $mail->Body .= "<p>Email: " . $a_row['email'] . "</p>"; $mail->Body .="</body></html>"; // not sure how $mail-->Body in OOP but that is the general idea from a procedure guy. // etc.... } // end database code $result = $mail->Send(); echo $result ? 'Thanks for your registering... Your information has been recorded in our database.' : 'Error'; ?> </body> </html> ---------------------------------------------------end of code--------------------------------------------------------------
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.