uploads - Send attachments via wp_mail from temporary folder

admin2025-06-02  0

Is it possible to send attachment via wp_mail, using temporary file, instad of uploading them to any actual folder on server?

For example:

<input type="file" name="file">

$attachment[] = $_FILES['file']['name'];

wp_mail(....,$attachment);

Documentation:

The filenames in the $attachments attribute have to be filesystem paths.

How can i get the path for temporary file (if this is possible)?

Is it possible to send attachment via wp_mail, using temporary file, instad of uploading them to any actual folder on server?

For example:

<input type="file" name="file">

$attachment[] = $_FILES['file']['name'];

wp_mail(....,$attachment);

Documentation:

The filenames in the $attachments attribute have to be filesystem paths.

How can i get the path for temporary file (if this is possible)?

Share Improve this question asked Dec 10, 2014 at 10:44 Biker JohnBiker John 1536 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

Yes. it's possible. Attachment file contents are taken by wp_mail call.

Use $_FILES['file']['tmp_name'] for filename

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748830244a314077.html

最新回复(0)