can a .doc or .docx file be send through an email in the attachment?


i have a .doc file (file attached ). is that possible when user finish filling out the information, the user can just click the sumbit and sent the file as an email attachemnt to me?

Thank you so much for your suggestion!!

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


there are couple of different way
you can use the normal web form to get the user data and when user submit at that time on server create word document object and create document or you can create word document template and then use that template to create the final document and then use CDONT mail object to send mail to you
lilyyanAuthor Commented:
thank you for your reply!

could you please be more specific about the different ways?

is there a built-in function in MS Word that can send the file as an email attachment ?

i'm using php. is that possible you may post a php sample, so i could better understand the process?

thank you so much !!
the best and fast way to generate and send the word document is
generate HTML document and then rename it to .doc and it will open up as word doc with all formatting

send email using PHP -
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

lilyyanAuthor Commented:
could you please have an example for :

>>the best and fast way to generate and send the word document is
generate HTML document and then rename it to .doc and it will open up as word doc with all formatting

i'm kind of still not sure :-)) thank you so much!!
once user submit the data, generate the HTML file as below then rename it to .doc extension and then send it as attachment

for test save the below code as .doc file and then open the file in word, it is very easy

<table><tr><td><b>Requested Visit Date</b></td><td></td></tr>
<tr><td>Start Time</td><td>End Time</td></tr>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lilyyanAuthor Commented:
well, here is several steps involved here

1. generate the HTML  // how to do this step in php

2. rename it to .doc extension . // same question as above

3.  then send it as attachment. // well, the link you posted is for text and html attachment in php, not for .doc file

thank you so much for your reply!! : )
Please follow the below link to generate HTML .doc file, no need to rename the file
file create --- here instead of creating .txt file create .doc file, also manipulate the myText code where in it writes the myText textbox content to file, instead of that write HTML tag like
"<html><body><table><tr><td><b>Requested Visit Date</b></td><td>.......CONCATE your other tag and data here

Email - for email with attachment use "Sending Email with Attachment" section
of send email using PHP -
and modify the attachment code
//and split it into smaller chunks
$attachment = chunk_split(base64_encode(file_get_contents('')));

or use

lilyyanAuthor Commented:
Really appreciate you reply! yet it's a little too completed ... : )
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.