phpmailer

phpMailer sending attachment name, not attachment

不羁岁月 提交于 2019-12-12 19:12:42
问题 Hi I have a file upload field with name="file1" and code in a phpmailer script: if (isset($_FILES['file1'])) { $file1_path = $_FILES['file1']['tmp_name']; $file1_name = $_FILES['file1']['name']; $file1_type = $_FILES['file1']['type']; $file1_error = $_FILES['file1']['error']; $mail->AddAttachment($file1_path); } And for some reason, it attached like php45we34 (each time diff, seems that its the temp name path, not the actual file) Any help? 回答1: I suggest you to use function move_uploaded

How to install phpMailer in a shared hosting environment?

南楼画角 提交于 2019-12-12 17:21:19
问题 How to install phpMailer in a shared hosting environment? I need to use this for email verifications and password changing of the users. 回答1: You can download it here: https://github.com/PHPMailer/PHPMailer Upload the folder to your server and include the main file with this line: <?php require 'phpmailerfolder/PHPMailerAutoload.php'; ?> After that, you will need an external SMTP account, like gmail.com for example. Here is a working example of PHPMailer with GMAIL: <?php require

PHPMailer Authentication unsuccessful

你说的曾经没有我的故事 提交于 2019-12-12 17:01:11
问题 When I try to use PHPMailer on windows server 2012 at work to send report emails using SMTP I got Authentication unsuccessful error. I'm using server administrator account on domain. I'm very sure of the correction of the password. check the code below: require '../PHPMailerAutoload.php'; $mail = new PHPMailer; $mail->isSMTP(); $mail->SMTPDebug = 2; $mail->Debugoutput = 'html'; $mail->Host = 'mail.example.com'; $mail->Port = 25; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true; $mail-

Setting up PHPMailer using Bluehost account

℡╲_俬逩灬. 提交于 2019-12-12 17:00:21
问题 I tried contacting support from Bluehost but they don't know how to set this up. What I did is first create my email account(VPS account). Then get all the details of my email setting. Email Settings Mail Server Username: notification@website.co Standard (without SSL) Incoming Mail Server: details here Supported Ports: 143 (IMAP), 110 (POP3) Outgoing Mail Server: details here Supported Port: 26 (server requires authentication) So on my PHPMailer code I added this: $mail->SMTPAuth = true;

Microsoft Exchange doesn't render email generated by PHPmailer as HTML

╄→гoц情女王★ 提交于 2019-12-12 14:14:42
问题 This issue has been annoyed me for weeks. I have a script which sends html email with xls attachmentm to multiple recipients with the help of PHPmailer. It has been working fine for more than one year. Recently two recipients from the same company, who use Microsoft Exchange as their email client, receive this email as text. Following is sample email they receive: --b1_dbc2cccc876da210fd56ae7a2601e692 Content-Type: multipart/alternative; boundary="b2_dbc2cccc876da210fd56ae7a2601e692" --b2

How to validate SMTP credentials before sending email in PHP?

江枫思渺然 提交于 2019-12-12 14:14:34
问题 Since it's so hard to find an answer, I'm thinking this might be impossible. If so, I'd like confirmation that it's impossible. 回答1: It is not impossible. You can program the SMTP interaction yourself and check for confirmation in the SMTP protocol that the credentials were accepted. For that approach, you would have to do socket-level communication with the SMTP server (e.g. using the [PHP Sockets] service1). To learn how the SMTP protocol works, try doing that with Telnet once by hand. http

How to secure a form which sends out emails

时光怂恿深爱的人放手 提交于 2019-12-12 13:27:42
问题 I have the following code which sends emails out. Is this good/secure enough for a production environment. i.e. will it stop bots, curl scripts sending spam using it, and stop email injections etc etc? <?php require_once('recaptchalib.php'); $privatekey = "private keys goes here"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { // What happens when the CAPTCHA was entered

i want to send email with attachments using phpmailer

北城以北 提交于 2019-12-12 10:28:23
问题 i am using phpmailler for sending mail,mail works successfully but without attachments. i want to send mail with attachments. i have tried this code. thanks in advance. $s2="select * from tbl_new_user where login_name='".$rw['clientname']."'"; $q2=mysql_query($s2) or die($s2); $row=mysql_fetch_array($q2); $s22="select * from tbl_job_schedule where clientname='".$rw['clientname']."' and jobdate='".$_SESSION['strmonth']."-".$_REQUEST['dt']."-".$_SESSION['yy']."'"; $q22=mysql_query($s22) or die(

use of phpmailer class

风格不统一 提交于 2019-12-12 09:57:30
问题 i m using phpmailer class for sending emails. i m geeting error "Could not execute: /smtp" the following code the code is below. can someone suggest me what is the problem. require '../class.phpmailer.php'; try { $mail = new PHPMailer(true); //New instance, with exceptions enabled $body = file_get_contents('contents.html'); echo $body; $body = preg_replace('/\\\\/','', $body); //Strip backslashes $mail->IsSMTP(); // tell the class to use SMTP $mail->SMTPAuth = true; // enable SMTP

Form to Email PHP Validation fallback using PHPMailer

浪子不回头ぞ 提交于 2019-12-12 09:29:35
问题 i have a basic contact form on a website. i need to send the form results to 2 email addresses... 1) me, & 2) a confirmation to the person who submitted the form. the form results sent to the submitter has a different message in it. i plan to add jQuery validation & Ajax but first i want to get the PHP to work. so i don't think i need a lot of PHP validation, just a basic - if critical fields are empty, then error message, as a fallback. i'm using PHPMailer but unfortunately their