473,785 Members | 2,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

attach file

Ken
I have a large text file that is send with mail.

I would like to save the text as a file (*.txt) and then attach it to the
email.

Can I do that with PHP?

How do I save the text $body as a file?

How do I attach (send) it to mail()?

Thanks for the help!

Ken
Jun 2 '08 #1
2 1941
Ken wrote:
I have a large text file that is send with mail.

I would like to save the text as a file (*.txt) and then attach it to the
email.

Can I do that with PHP?

How do I save the text $body as a file?

How do I attach (send) it to mail()?

Thanks for the help!

Ken


look at phpmailer - I believe it has this functionality - though I have
not used it...
Jun 2 '08 #2
Ken
Michael,
I set up PHPMailer. Great program.
I was able to send an attachment with PHPMailer.

Thanks for the suggestion.

Now the question is:
In PHP, how do I convert a php $body= " " which includes text + variables
into a .txt or .html file so the saved file has the value of the variables
rather than the $variable?

Ken

"Michael Austin" <ma*****@firstd basource.comwro te in message
news:ZA******** *********@newss vr27.news.prodi gy.net...
Ken wrote:
>I have a large text file that is send with mail.

I would like to save the text as a file (*.txt) and then attach it to the
email.

Can I do that with PHP?

How do I save the text $body as a file?

How do I attach (send) it to mail()?

Thanks for the help!

Ken


look at phpmailer - I believe it has this functionality - though I have
not used it...

Jun 2 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
3728
by: tabonni | last post by:
Hi I try to grab the checked files from HTML page and then send those PDF files as attachments. It can just send email, there are no PDF files attached. Can anybody point out my error? My idea is: When people check the check boxes in HTML page for the PDF files, it will transfer the files' name to ASP page. Then, it will attach it in the email.
1
1758
by: RickL | last post by:
How do you attach a file to a hyperlink so that it cab be opened when clicked? I am new to .net and web development and I need to attach a file to an asp page so that when click it can be opened it Word, or the text editor.
5
1504
by: erez | last post by:
Hello How can i attach an html file to TableRow in HtmlTable control that run at server, the code should be in server side. thanks
7
2758
by: Greg P | last post by:
I know this is a long post, please bear with me. I have been working on this all weekend to no avail although I have done a good amount of research (see most pertinent links that I've looked at below). Please help me get through this!!! I'm having some serious problems attaching a .mdf file and accessing it. I have a WroxUntied.mdf that I want to attach and then run the website that uses it. This is a .mdf file from wrox books. This file...
6
2534
by: a | last post by:
What is the best way to construct an email in python and also attach a html file the html file to be attached is not on disk, but should be dynamically constructed in the python script I want to attach the django debug error to an email and mail it to myself whenever there is an error in the application thanks a lot
3
2252
by: mse07 | last post by:
hi for every one i have program using to send e-mail but i want to attach text file with that e-mail . how attach text file with e-mail automatically ? example : every time send e-mail i want attach text file example : c:\xx.txt .
0
2524
by: Lexxzy | last post by:
Hi to all, I've a problem about to attach a recovered database file in the enterprise manager. My problem goes this way, I want to attach a recovered database file. So when I followed this steps: 1.) Open enterprise manager. 2.) All task and then attach database.
7
2736
by: RRsonawane11 | last post by:
Hello, Can anyone know how to write asp code to attach one file and email it to a specified email address. The attach file is the client choose from their Local Harddisk, just like we using yahoo mail or hotmail , allow us to attach file and sent it.
14
2333
by: sreemathy2000 | last post by:
My requirement is to generate and attach a file and send in an email automatically. i have a existing functionality where i using the code below to write a CSV file in my local system. StreamWriter sw = File.CreateText(fileName) sw.Write(m_Model.Csv); the new functionality is to attach the file to email and send automatically. i cannot store in some path and attach since access issues might come later. Is there any other way to...
9
7811
by: dpatel75 | last post by:
I am trying to copy a database from a SQL 2000 SP3 Windows 2000 server to a 2005 SP2 Windows 2003 server. I am trying to use detach and attach method (have tried both within Management Studio and T-SQL) and experience an error when attaching to the 2005 server: "CREATE FILE encountered operating system error 5 (error not found) while attempting to open or create the physical file 'xxxxxxxxxxxx' (Microsoft SQL Server, Error: 5123)" I have...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10341
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9954
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7502
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.