By gr8cms on
Hi
Excuse me, I am looking for this subject in drupal.org, but I don't find a good solution.
How can I attach a file with an email?
Please help me for the best solution.
Hi
Excuse me, I am looking for this subject in drupal.org, but I don't find a good solution.
How can I attach a file with an email?
Please help me for the best solution.
Comments
Your question could mean
Your question could mean anything. I guess you are not asking how to click the "Attach a file" button in your email program or in your web mail provider's page. You will need to explain what are you trying to do.
If you want to create Drupal posts using emails with files attached, check the modules http://drupal.org/project/mailhandler and http://drupal.org/project/mailsave
thank you for your
thank you for your answer
yes, I want to do attach a file(.doc, .docx or .pdf) with my email.
please give me a simple and good solution.
your links was not useful for me.
Sorry to hear that.
Sorry to hear that.
Instead of calling
Instead of calling drupal_mail function call the following function and pass your attachment file paths as an array
function call should be like this
$attachments[0]='Your file path';
drupal_mail_wrapper_attachment('user-register', $user_obj->mail, $subject, $body, null, $headers, $attachments);
Excuse me, can u tell about
Excuse me, can u tell about attachment file?
It must be select from local or host?
from the host
from the host only
Ex:
$attachments[0]= file_directory_path().'/bill/new/meha.pdf';
How about if I want to email
two more question:
1- How about if I want to email a file directly selected by the user from his computer(I mean a file that is located on a local computer).
2- and how can I include phpmailer class in my module?
thanks in advance.
You have to move that file to
You have to move that file to server then only we can attach to that mail and also you need to enable SMTP module which requires phpmailer so you can download it from the following URL or from some other location also and put it into the smtp module folder.
I did something that you
I did something that you told, but I have an error like: "Fatal error: Class 'phpmailer' not found in"
please, help me
thanks in advance
i given that function for
i given that function for drupal5 if you are using drupal6 then you just replace $mail = new phpmailer(); with the following line i hope you have placed the phpmailer inside the smtp module.
Thks!
hi thanks for the function!
My smtp is working (the test mail), but when I use the function I'm getting "Error sending email:SMTP Error: Could not authenticate."
any ideas where this could be comming from?
We encountered a frustrating
We encountered a frustrating bug related to encryption protocols. We found that the SMTPSecure property needed to be set to send attachments through gmail using TLS and SSL. A slight modification was required to the code above.