-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow preSend() without recipients #2948
Comments
I don't know that that would be effective because PHPMailer wants to build the MIME structure for you, and it's generally tricky to get it to send an already-formatted message. Have you worked around that already, or are you only using PHPMailer for constructing messages and sending them some other way? Alternatively I'd suggest storing the original raw message body and passing that into PHPMailer when you're sending, letting it build the structure as it sends rather than trying to shortcut that. |
I am using it for both sending and those templates. So when I want to save the template I call preSend() and then get the MIME with getSentMIMEMessage(). Works fine but only if a recipient is set. |
Yes, I understand that, I'm saying that it would work better if you didn't do it that way. Why do you need to save the fully formatted message when it's impractical to use that as a template (because encodings will really get in the way), and it's much more difficult to send it later (because PHPMailer doesn't make it easy to send an existing RFC822 message)? |
You're right. I do it that way for legacy reasons. The MIME is decoded when loading the template editor which works fine but I understand it can be done more efficiently. We need to refactor that later but for now I can't do that. |
So, if it is not the intended use of the PHPMailer software and if it is temporary, and you are refactoring this later on; why not temporarily make those changes in your local version of PHPMailer until you are using it the proper way? In essence, make your own fork of the code |
Yes if it’s not an option you’d like to support I’ll go that route. thanks. |
Hi,
I have a small feature request. In my application I store mail templates in MIME format. For that purpose I don't want any recipients inside.
At the moment it's not possible to create this because of the validation at line 1568. Perhaps you could set a property "allowNoRecipients" or something like that.
Best regards,
Merijn
The text was updated successfully, but these errors were encountered: