Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Mail Attachment Saving Function


here's a little function I threw together that can save attachments from messages retrieved via the IMAP library.

Note that the function takes two arguments, the first being the mailbox opened by imap_open(), and the second the message number of the message you want to retrieve the attachments/body from. note that the function dosn't check the validity of a message of $mnum actually existing, as in the code I wrote it for, the message number was checked for validity before calling the function. The function returns a string containing the body of the message, as well.

Oh yea, it also dosn't save attachments of type 0 (7-bit) and 5 (Other). still playing with that functionality.




View Complete Forum Thread with Replies

Related Forum Messages:
Use The Function Mail() To Send An Attachment
Is it possible to use the function mail() to send an attachment, if so how would I do this?

View Replies !
Send Mail Using Mail() With Attachment
im trying to find out how to send an email with the mail() function and add an attachment

basically i want the user to be able to send an email and browse their computer and attach a word doc to the email any ideas on the attachment bit ?

View Replies !
Mail() With Attachment(s)
Can anyone point me to where I can find examples of sending email with attachments from php? I came across something last year and tried it out, but was not successful. I would like to be able to include an .xml file as an attachment as well, if that matters.

View Replies !
Mail() And Pdf Attachment
I am trying to send a pdf file as an attachment with the mail()
function. Unfortunately, the pdf file does not show up as an
attachment. I get its coding as text along with this:
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="==Multipart_Boundary _x893cd7b85e299baba9cd7ab91338 4411x"
--==Multipart_Boundary_x893cd7 b85e299baba9cd7ab913384411x...

View Replies !
E-mail Attachment
Is there any way one might go about saving e-mail attachment from messages fetched via the IMAP functions in PHP?

View Replies !
Attachment To Mail
I want to be able to attach a file on the contact-us side ....

View Replies !
PHP Mail() With Attachment
I have a long application form for a modeling photographer.  It asks a few questions at a time, and then moves them on to the next section. 

The last section has them enter a photo.

What I want to do, is get the photo onto the server (done)

Send the photo to the owner in an email attachment with the rest of their info (got everything except the attachment part)

Then delete the photo (I know how to do this)

IF (mail($mailto1,$subject,$body, "FROM: $mailfrom
Reply-to: $mailfrom"))

That is the way I am sending the mail.  Of course above it all the parts are defined.  What needs to be added to this to have the image sent with it as an attachment. 

View Replies !
Mail Attachment (pdf)
I have some weird problems attaching dynamically generated pdf documents to an email. most people who receive the mail cannot open the attached pdf, though it is shown as one. there must be something wrong with the encoding i think, but i didnt find a solution. its weird, because if i send the mail to my adress, it works perfectly (tested with firefox as mail-client).... but not on my clients' accounts, the other way around would be better i am using fpdf to generate the pdfs.

PHP Code: .....

View Replies !
Using Mail Attachment
Im using phpmailer to send mail through smtp and I can attach an image like
$mail->AddAttachment("/tmp/image.jpg", "new.jpg");But how can I use that image in my email itself?

View Replies !
Problem With Mail Attachment
Can anyone enlighten me as to why I get this: Code: Message-Id: <E183ibR-0008Vu-00@blue.srv2.com>
Date: Mon, 21 Oct 2002 20:52:41 +0100
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - blue.srv2.com
X-AntiAbuse: Original Domain - ski-info-online.com
X-AntiAbuse: Originator/Caller UID/GID - [99 99] / [99 99]
X-AntiAbuse: Sender Address Domain - blue.srv2.com

MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=====7b74a59b31c591dd6764d734258a5c99====="

--=====7b74a59b31c591dd6764d734258a5c99=====
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Test Message

--=====7b74a59b31c591dd6764d734258a5c99=====
Content-Type: image/gif; name="1star.gif"
Content-Transfer-Encoding:base64
Content-Disposition: attachment; filename="1star.gif"

R0lGODlhCgAKALMAAAAAAO/GGL2cAP/WMf//Ss61If//Kf/3Ib2tCPfWGP//Wv///wAAAAAAAAAA AAAAACH5BAUUAAsALAAAAAAKAAoAAAQscMkFwLxgGCtrTZsHKIYBlooFCEFpHBwlIG9MIYKwTUCR VAICB/DrCGI2TgQAOw==
--=====7b74a59b31c591dd6764d734258a5c99=====-- When sending mail attachments. Here is my code: PHP Code:

View Replies !
Mail Attachment Security
I have created a script which attaches form uploaded files to an
email. What security is suggested to prevent attachments which may
contain viruses, etc. from being uploaded? I am running finfo_file()
to determine the mime-types of the files being uploaded, so it should
easy to exclude certain types of files based on this, or the file's
extension.

Also, I would like to send an alternative text with this email. Is
there a good script out there that removes HTML and converts to simple
formatted text?

View Replies !
Sending An Attachment With Mail()
I have been trying for a while to send an attachment with the PHP mail function. The problem is that the body of the message is always the contents of the attachment. For example, I have a text file whose contents is the line: "12345".

I attach this message using my mail function and have the body of the mail as "Hello there". When I receive the text file and open it, the contents read "Hello there" instead of "12345". My mail function generates the following information: Code:

View Replies !
Mail Attachment Questions...
I've found a script at these great Google fora. a script
to send emails with attachments.
The script is below this message, name etc. aren't mine, but from
the original post.

My questions are:
- Is this script extra heavy for a server, or should it be
no problem?
- How big do you advise for max size of attachments?
- Why is the attachment set in an array, when i remove the
array and only leave it's content-text i get a big time error.
- Why is this in there? --> $message .= str_replace ("=", "=3D",
$html_message)."
";
- In the source of the mail, there are a few THOUSAND lines of
the following text. Right after "Content-ID: <image.jpg>"
"Do1QlNSe3k6QmpmR0hJTERWWlVhh4EQABAgQDAggIBwoKBwgCA wABAgMA"
what is it for? Does it delay my server?

I'm sorry if this seems kind of lazy from me, but i'm a newb so i
don't
know how to figure it out else.

code from script below found at:
http://groups.google.nl/groups?hl=n...hello.at&rnum=3
__________________________________________________ ____________
<?php
function sendmail ($from_name, $from_email, $to_name, $to_email,
$subject, $text_message="", $html_message="", $attachment="")
{
$from = "$from_name <$from_email>";
$to = "$to_name <$to_email>";
$main_boundary = "----=_NextPart_".md5(rand());
$text_boundary = "----=_NextPart_".md5(rand());
$html_boundary = "----=_NextPart_".md5(rand());
$headers = "From: $from
";
$headers .= "Reply-To: $from
";
$headers .= "X-Mailer: The Bat! (v2.04.7) Personal
"; // say
we are
the bat mail client ;-)
$headers .= "MIME-Version: 1.0
";
$headers .= "Content-Type:
multipart/mixed;
boundary="$main_boundary"
";
$message = "
--$main_boundary
";
$message .= "Content-Type:
multipart/alternative;
boundary="$text_boundary"
";
$message .= "
--$text_boundary
";
$message .= "Content-Type: text/plain;
charset="ISO-8859-1"
";
$message .= "Content-Transfer-Encoding: 7bit

";
$message .= ($text_message!="")?"$text_message":"Text portion
of
HTML Email";
$message .= "
--$text_boundary

View Replies !
Multiple Mail Attachment
How do enable the people to attach more than one file? This is portion of my code but it enable only one file to be attach. May i know what's wrong with it? Code:

View Replies !
Mail Form With Attachment
im a beginner and need to modify a script, instead of the attachment being sent to the admin email i need it to be delivered back to the sender, Code:

View Replies !
Sending Attachment With Mail()
How can i simply attach an file (word.doc) to an e-mail with the mail()
function



View Replies !
Sending Attachment Using Mail()
<?php
$header .= "From: ".$email."";
$mailresult  = mail($to,$subject,$msgtxt, $header); ?>

How can I add a PDF attachment to the above?

View Replies !
Html/PHP Mail Attachment
I've managed to put bit's and pieces of code together to create an online email form with attachment.

When I click on send the email gets sent and my email client doesn't tagg it as a spam, which is good, BUT the attached file size is 0.0 Kb. The name of the attached file is correct and the format, but it's empty. Code:

View Replies !
Having Problems With Mail Attachment
I am looking for a way to get email attachments together with reply's from the server.
You fill in a webform and based upon that you recieve an email with a specific attachment in it.

I already found this script on this forum : Link

I tweaked it a little bit and came up with this:

Code:

View Replies !
Mail Attachment Parser
I've had a look at PHP Classes for a mail parser and there seems to be quite a few on there. Does anyone here recommend a particular reader? I want something really simple.  All I want to do is be able to save an image that's attached to an email. That's all.  I guess I'll need to connect to the mail server and retrieve the specific email (something I can already do with sockets) but just need to parse the attachment string.

View Replies !
Mail Attachment Problems
I am sending attachment with mails using PHP mail function. The mails are getting despatched to the intended receipents but the attachments are getting converted into a .tmp file. Also an additional .txt file is getting generated with the attachment.

My PHP version is 4.3.3

View Replies !
Sending Mail With An Attachment
I know how to send a file as an attachment when the file is in my file system. Now I want to send data as attachment without saving it to the filesystem first. Under UNIX shell what I do is uuencode and dump the output at the end of the 'data' part of the message. How can I convert the string to an attachment without the mediation of
the filesystem.

View Replies !
Retrieving An Attachment From A Piped Mail
Here's the deal :

I get from a coworker some mails with a ZIP file attached. I've created an
email aliases that resends the mail to a program using the smrsh mechanism.
My problem is that I'd like to extract the ZIP file from the mail with
this prog, but I don't find out how to do this. read somthing about the
RFC 2054, but doesn't help much more...

View Replies !
File Uploading For Mail-attachment
I'm working on a simple form where visitors can select a file on their local machine
When they submit the form, a mail-message should be sent to the webmaster, with that file as an attachment. Does anyone know how to to this? (in php would be great, but perl is also possible).

View Replies !
Bulk Mail() + Attachment In A Loop
I have the idea that sending bulk mail in batches is the thing to do. Script timing out [max_input_time ?], spam, and such. About 500 on the mail list. I send in lots of 100.

Are batches a good idea?
Not necessary?
Other thoughts?

Attachments:
I have got the script sending an attachment - in a single batch loop.
But, from the PHP manual

>> file will be deleted from the temporary directory at the end of the request...

I presume this means the end of the first batch.

So, I hesitate to charge off exploring alternatives without your guidance. My script hand is slow and debugging can be tediously slow - especially with mail script as it can only be done on-line and I am on 36k dial-up at the moment.

My first thought is to literally upload the file to my server and unlink on completion of the last batch.

View Replies !
Using Form To Send Mail With PDF Attachment
I have a form to be filled in by the user, which includes an upload file feature. This is going to be a PDF but I haven't restricted it to this thus far. Anyway, this PDF is uploaded and an email is sent to the administrator, but I want to send this PDF as an attachment in this email.

So far I've managed to send a PDF as an attachment, but not part of this form. The upload part is fine, I just can't intergrate the PDF attachment into the email in this form.

I was wondering if anyone had any scripts lying around which dealt with this issue; just reading in the users selected file and attaching it to an email.

View Replies !
Mail Attachment Not Working - Any Ideas?
I'm working on making an email script to be able to use file attachments. I've got a form that the user can fill out, with one of them being the field "pdfupload" where the user can upload a file. I cannot get the file to come through as an attachment to the email. It seems to send the email just fine, but with no attachment. Code:

View Replies !
PHP Mail Attachment Works Except In Windows XP Office
Short description:
I've got a product (myprod.mxp) which I deliver via email and it works in Windows 2000 Office, Yahoo, etc - but not in Windows XP Office. I can attach the file in Yahoo and it makes it to the Windows XP Office account - so something needs to be changed in the script *or* I need another script to send out the attachment.

Long description:

Here is the script I am using to email the product to the customer, what changes should I make to allow Windows XP Office to receive the email attachment, it comes across inline with the message (long string of garbage characters)

View Replies !
Form Mail Script With File Attachment
I was wondering how to allow a user to send feedback from a website and also have the abilty to upload a file from their computer to a temp location on the webserver and then attach this file to the email. Needs to possibly work in PHP 3, but 4 would be fine.

View Replies !
Receive And Handle Incoming Mail With Attachment
I need to have some sort of script that when an email with a picture attachment is sent to for example user@mysite.com, the script can save the attached picture as a file and get the subject and message of the file. need urgent help on this matter.

View Replies !
Error In Sending Html Page With Attachment In Mail
i am sending a mail with attachment. the text mail with attachment is going in rght way ...but when i try to send a HTML Mail(text coming from a HTML Editor) with attachment the mail .. i got some kind of error ... the mail and attachment goes .. but the problem is the HTml page display as its is ...like its display as source code whatever a typed in editor..

View Replies !
Sending Attachment Form Local Drive With Mail()
With them help of newsgroups I created a form that makes it possible to sent
an email with an attachement thats on the internet.. How can i attache a
file thats on the users hard drive? ....

View Replies !
Mail() Function - Using The Mail() Function To Send Emails To Members Of A Website
I am using the mail() function to send emails to members of a website. For some reason when I include words such as "free" or "winner" the mail does not send to any of the addresses - it just seems to disappear in space. I figured this out by trial and error - once I removed those words, it worked. I am running cPanel on the server and have no problem sending emails as long as they don't use those words. It seems to be blocking certain words - ones that I assume spammers would use.

View Replies !
Mail Problem - Warning: Mail() [function.mail]: SMTP Server Response: 550 Invalid Recipient:
Whenever the recipient's email address includes a hyphen ( - ), I get the following error message...

Warning: mail() [function.mail]: SMTP server response: 550 Invalid recipient:

I should stress that this only seems to occur when the hyphen is in the URL portion of the address, i.e example@perfect-example.com

The current code works along the lines of...

mail ($_POST['email'], 'Email subject is here', $body, $headers);

View Replies !
Saving Result Of Function Without Being Echoed
I am trying to save the function "rand(1, 1000000)" in a variable but when I am for example trying:

$randomnumber = rand(1, 1000000);

it is executing it right ahead while when i try

$randomnumber = "rand(1, 1000000)";

or

$randomnumber = 'rand(1, 1000000)'

It is saving rand(1, 1000000) as variable.

But what I need is a variable saving the result of rand(1, 1000000) so the number does not change either.

Any ideas how I would do this?

View Replies !
Saving Form Variables Using A Java Function
I would like to know if it is possible to save a value from a php form in a session using a java function. What I am doing:

I have a php form. The form contains a textbox and 2 list menus (drop down box) The second drop down box relies on the selection made in the first.

within the reload() java function I save the value entered in the first list menu (using the onChange="reload(this.form)" ) I pass the variables in the url. The users selection loads values into the second list menu. Where the user can make a second selection. This value is passed using the same method.

What I would like to do is save the textbox (or all the entered values) values in a session using a java function. When the user changes the a value or enters one.

View Replies !
A PHP Function For Saving An Image To The Local Hard Drive?
I am looking for a PHP function that when run, would save an image to
the user's hard drive.

View Replies !
Warning: Mail(): Bad Parameters To Mail() Function, Mail Not Sent. In /
I have a website with a contact form and I tested to see if the form would actually send the submitted info to my email but I get this error...

Warning: mail(): Bad parameters to mail() function, mail not sent. in /home/content/g/o/l/goldenhills/html/email_us.php on line 62

Here's the php code:

View Replies !
Use The Mail() Function: Warning: Mail() [function.mail]:
I am trying to use the mail() function. I've got my php.ini file configured to use my current smtp host (Verizon) and I get this error:

Warning: mail() [function.mail]: Failed to connect to mailserver at "outgoing.verizon.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:www est.php on line 39

So I'm asking two things.
1) How can I make this work with out using Verizon's SMTP server? The server I am using for this website is a Windows XP machine with Apache as the webserver.
2) Once I have an alternative smtp server option, what is it I need to do to set it up properly?

I need an alternative smtp server because this machine is just a development machine at my house, while the file site is in a colo and isn't connect to verizion or anyone else with a smtp server.

View Replies !
Mail() [function.mail]: SMTP Server Response: 550 Not Local Host Gmail.com
I do a mail() and get:

Warning: mail() [function.mail]: SMTP server response: 550 not local host gmail.com, not a gateway in C:xamppxampphtdocs estsitemail.php on line 7


<?php
ini_set("SMTP","rlwatkins.com");
ini_set("sendmail_from","hunter@rlwatkins.com");
mail("huntercjcarroll@gmail.com","hello me","spamtastic","From: hunter@rlwatkins.com");
?>

what is wrong with this, how do i set it so that i can send to something other than localhost?

View Replies !
Warning: Mail() [function.mail]: SMTP Server Response: 501 Syntax Error
When I try this under windows :

mail("User <user@example.com>",$subject, "", $headers);

I get this error :

Warning: mail() [function.mail]: SMTP server response: 501 Syntax error,
parameters in command "RCPT TO:<User <user@example.com>>" unrecognized
or missing in

It seems to add it's own <> characters. If I run the same script under Linux it works fine !?

View Replies !
Warning: Mail() [function.mail]: SMTP Server Response: 501 5.5.4 Invalid Address
I receive this error:


PHP Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in D:clientsebiblecommentary.comconcordia-seminary.caconcordia-seminary.ca\_demo
egister.php on line 464

Both of my mail() uses fail, and I'm not sure why. I've followed the same syntax before on this my server and not had a problem.

My code is below: ....

View Replies !
Warning: Mail() [function.mail]: Permission Denied: Headers Injection
I wrote many years ago a small shop application as hobby for a customer. Worked well until a few days. I'm not a php guru and don't understand why I get now this permission problem.

Warning: mail() [function.mail]: Permission denied: headers injection (empty line) in /home/www/edfedca4df03c5ff2685003537a08dd5/web/minishop/mail.php on line
145

mail($this->to, $this->subject, "", $mime); <- LIGNE 145

View Replies !
Warning: Mail() [function.mail]: SMTP Server Response: 550 5.7.1
I'm making e-mailing with php script and i setup mailtraq mailserver this thing is just a lil confusing to me first thing i want to know if i can use apache instead of this as mail server second when i wrote my script with that mail function i received an error this is it :

Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for monalisa20042006@yahoo.com in D:wampwww1stmail.php on line 2

what's that mean if this means that the mail server not configured right...SO third how to use or configure this server to use as my mail server. Code:

View Replies !
Warning: Mail() [function.mail]: Failed To Connect To Mailserver
Why do i keep getting this error:

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:wampwwwproject_upload Code:

View Replies !
Get The Mail Function To Send Mail After Processing My Forms Locally
I am using an Apple Mac Book Pro computer on which I am running MAMP (Macintosh, Apache, Mysql, PHP) I can not get the mail function to send mail after processing my forms locally. I checked the php.ini file to see what could be the problem and I believe I have it configured properly.

View Replies !
Warning: Mail() [function.mail]: SMTP Server Response: 553
my php.ini mail section is setup as follows:

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

then in my php script:
<?php
mail("joecool@hotmail.com", "Testing", "Line 1
Line 2
Line 3", "From: tom@hotmail.com") or die("email error");
?>

i have also run mercury mail but i keep getting this error:

Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail, sorry. in C:Program Filesxampphtdocsest.php on line 2

on all tutorials that i went, the mail function is written this way what is wrong?

View Replies !
Sent Attachment Received As Empty Attachment.txt?
When emailing a file using PHP 4.0.6, the attachment received is an empty "attachment.txt" file instead of the actual file I attached. Code:

View Replies !
Emails Blocked By Certain Mail Hosts? (mail() Function)
I'm using mail($address,$subjectheading,$message,"From:
me@mysite.com") to send emails from my site. For the most part, it
works okay (for example, I receive the mail in my Yahoo box). But when
I check my university email, the message is not delivered. I thought
maybe it was because I had included my web address in the subject
heading and that it was being filtered out, but I removed that from
the subject and it still fails to get through. I'm making a wedding
site for some friends now and they want to be able to email everyone
on their guest list at once, but I'm afraid the same will happen to
some of these addresses as well. Any comments/suggestions on what may
be blocking the mail and how I can get around it? I'm not trying to
send out any kind of mass ad mailings or anything. Just to people on a
mailing list for this site.

View Replies !
Mail Function :: Send Form In HTML Mail
I am trying to use the PHP mail function to repopulate the information that has been filled out on a form and send the form out in an html email the same way that it looked when the individual filled it out. The problem I am having is with the Radio buttons and repopulating them. Code:

View Replies !
Mail() [function.mail]: Failed To Connect To Mailserver
i need to know how to enable my mail function i have change my ini to localhost port 25 and enabled emnail but nothing is changing anyone experienced this problem before.

View Replies !
Php Mail() Function Doesn't Send To Pop3 Mail Address
I'm writing a registration script for een webhosting company but the mail() function i used works only for hotmail addresses and not for pop3 email accounts, it also works for other not pop3 email accounts, does any one know what i should do to make this work. I used the same method before on an other server and there it worked perfectly.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved