Having trouble with PHPMailer

Here is a working example: <?php function SendMail( $ToEmail, $MessageHTML, $MessageTEXT ) { require_once ( ‘class.phpmailer.php’ ); // Add the path as appropriate $Mail = new PHPMailer(); $Mail->IsSMTP(); // Use SMTP $Mail->Host = “smtp.gmail.com”; // Sets SMTP server $Mail->SMTPDebug = 2; // 2 to enable SMTP debug information $Mail->SMTPAuth = TRUE; // enable SMTP authentication … Read more

How can I download all emails with attachments from Gmail?

Hard one 🙂 import email, getpass, imaplib, os detach_dir=”.” # directory where to save attachments (default: current) user = raw_input(“Enter your GMail username:”) pwd = getpass.getpass(“Enter your password: “) # connecting to the gmail imap server m = imaplib.IMAP4_SSL(“imap.gmail.com”) m.login(user,pwd) m.select(“[Gmail]/All Mail”) # here you a can choose a mail box like INBOX instead # … Read more