phpmailer

Php attachment from string

故事扮演 提交于 2019-12-11 13:26:43
问题 I have a script generating .pdf file. This script return this file as string and then I can save it with file_put_contents() $output = $dompdf->output(); file_put_contents("myfile.pdf", $output); I want to add this file as attachment to my email using PHPMailer. If I have a file on disk I just write path to it and new name: $mail->addAttachment('/path/to/file.pdf', 'newname.pdf'); But can I add attachment without saving myfile.pdf to disk? Something like that: $mail->addAttachment($output,

Email filled PDF with PHP or PHPMailer

倖福魔咒の 提交于 2019-12-11 12:38:31
问题 My company is currently trying to streamline our process for submitting forms. I have read that what we are trying to do can be done with PHP or PHPMailer but I seem to have hit a roadblock. What we are trying to do is open a fillable PDF in browser, complete it, and then click a button at the bottom to email it to a designated recipient. I currently have a PHP script that allows me to email the blank document using PHPMailer and our server email service. I have tried using the

PHP Mailer - Email is not sent for more than 100 KB attachment

我的梦境 提交于 2019-12-11 12:34:06
问题 I am using PHPMailer library for sending email. I have uploaded code to different server and now email is not working for attachments of size more than 100 KB. It is giving error "Cannot instantiate mail function.". It works with attachments less than 100 KB. It seems that there might be some size limit on the server. If this is the case then where to check this ? I am using windows server , following are the settings in php mailer $mail = new PHPMailer(); $mail->isMail(); $mail->isHTML(true)

PHPMailer and SMTP: Mail never shows up when sent from remote server, works fine on local machine

我的梦境 提交于 2019-12-11 12:09:32
问题 I have a script that uses PHPMailer to send out an email. The email is sent with a direct SMTP connection to a remote mail server. The problem is that while everything seems to be okay when I run the script on my local machine, when the script is run on our live site using the same remote SMTP server the email never gets through. What's curious is that it seems to have worked at one point in time and has semi-recently decided that it just wasn't going to work anymore. What potential points of

PHPMailer and 100K file limit for attachments?

[亡魂溺海] 提交于 2019-12-11 11:57:17
问题 I'm trying to send a file as an email attachment, but for some reason if the file is > 100k then the email doesn't go through, even though I get the email sent message. It may also be a limit on the attachments in IIS smtp setting, but when I unchecked the Limit session size and limit message size options, it didn't change anything. I may have to restart the server tonight... I don't know if it's a php.ini setting, or what. <? $path_of_attached_file = "Images/marsbow_pacholka_big.jpg";

Fallback smtp servers with phpmailer

旧城冷巷雨未停 提交于 2019-12-11 11:04:15
问题 I'm using gmail as my smtp server with phpmailer(). $mail->Host= "ssl://smtp.gmail.com" How do i specify a separate smtp server just as a back up incase the connection to gmail fails ? 回答1: Check out this tutorial: http://www.web-development-blog.com/archives/send-e-mail-messages-via-smtp-with-phpmailer-and-gmail/ And go to the section: Advanced setup with fall-back SMTP server First add the variables for the backup email service, something like: define('SMTPUSER', 'you@yoursmtp.com'); // sec

how to combine form validation and phpmailer …?

坚强是说给别人听的谎言 提交于 2019-12-11 09:55:52
问题 I am trying to email a basic contact form using PHPMailer. This form works for me: <?php $first_name = $_POST['first-name']; $last_name = $_POST['last-name']; $email = $_POST['email']; $message = nl2br($_POST['message']); require 'PHPMailerAutoload.php'; $mail = new PHPMailer; //$mail->SMTPDebug = 3; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = ''; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail-

How to correctly fix phpMailer max execution time error?

和自甴很熟 提交于 2019-12-11 09:30:11
问题 I'm using phpMailer for sending emails from localhost, but I have had to do a quick fix to its main class to get it working. When I just downloaded phpmailer and used it, i got a max execution time error in my script: Fatal error: Maximum execution time of 30 seconds exceeded in /home/lol/desktop/web/mailtest/class.phpmailer.php on line 737 So, i went to line 737 in class.phpmailer.php and found a function to validate address: public static function ValidateAddress($address) { if ((defined(

How do i remove attachment form phpmailer when sending a different mail for second time in php

僤鯓⒐⒋嵵緔 提交于 2019-12-11 09:06:37
问题 In a php file i need to send 2 different emails to 2 different id's. It did not work when i used two variables like this shown below. require 'PHPmailer/class.phpmailer.php'; /* First Email*/ $email = new PHPMailer(); $email->From = 'admin@mywebsite.com'; $email->FromName = 'My Webisite'; $email->Subject = 'Subject of first email'; $email->Body = 'Body of the message to first person'; $email->AddAddress( 'to first person' ); $file_to_attach = 'path of the file'; $email->AddAttachment( $file

PHPMailer 5.2 OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

烈酒焚心 提交于 2019-12-11 08:28:27
问题 I'm getting this error with PHPMailer on a PHP 5.6 server. Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in class.smtp.php on line 344 The interesting thing is I'm trying to send email through the local SMTP server @ localhost, and I'm not using SSL or TLS - it's plain SMTP on port 25. $mail->SMTPSecure='' $mail->SMTPPort //not set The server has a valid SSL