function phpfmg_mail_password() { phpfmg_admin_header(); if (defined('PHPFMG_USER') && defined('PHPFMG_PW')) { $body = "Here is the password for your form admin panel:\n\nUsername: "******"\nPassword: "******"\n\n"; if ('html' == PHPFMG_MAIL_TYPE) { $body = nl2br($body); } mailAttachments(PHPFMG_USER, "Password for Your Form Admin Panel", $body, PHPFMG_USER, 'You', "You <" . PHPFMG_USER . ">"); echo "<center>Your password has been sent.<br><br><a href='admin.php'>Click here to login again</a></center>"; } phpfmg_admin_footer(); }
<?php $to = '*****@*****.**'; $from = '*****@*****.**'; $subject = 'See Attachments'; $message = 'Please review the following attachments.'; // Define a list of FILES to send along with the e-mail. Key = File to be sent. Value = Name of file as seen in the e-mail. $attachments = array('/tmp/WEDFRTS' => 'first-attachment.png', '/tmp/some-other-file' => 'second-attachment.png'); // Define any additional headers you may want to include $headers = array('Reply-to' => '*****@*****.**', 'Some-Other-Header-Name' => 'Header Value'); $status = mailAttachments($to, $from, $subject, $message, $attachments, $headers); if ($status === True) { print 'Successfully mailed!'; } else { print 'Unable to send e-mail.'; }