Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2008-11-04
8
Medium Priority
?
291 Views
Last Modified: 2012-05-05
hello:

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!!



testForm.doc
0
Comment
Question by:lilyyan
  • 4
  • 4
8 Comments
 
LVL 7

Assisted Solution

by:ASPSQLServerCOM
ASPSQLServerCOM earned 2000 total points
ID: 22877554
hi,

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
0
 

Author Comment

by:lilyyan
ID: 22877701
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 !!
0
 
LVL 7

Assisted Solution

by:ASPSQLServerCOM
ASPSQLServerCOM earned 2000 total points
ID: 22877791
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 -
http://www.webcheatsheet.com/PHP/send_email_text_html_attachment.php
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:lilyyan
ID: 22877878
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!!
0
 
LVL 7

Accepted Solution

by:
ASPSQLServerCOM earned 2000 total points
ID: 22878007
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


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

Open in new window

0
 

Author Comment

by:lilyyan
ID: 22878873
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!! : )
0
 
LVL 7

Assisted Solution

by:ASPSQLServerCOM
ASPSQLServerCOM earned 2000 total points
ID: 22880168
Please follow the below link to generate HTML .doc file, no need to rename the file
file create
http://www.tizag.com/phpT/filecreate.php
http://www.programmingtalk.com/showthread.php?t=13635 --- 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 -
http://www.webcheatsheet.com/PHP/send_email_text_html_attachment.php
and modify the attachment code
//and split it into smaller chunks
$attachment = chunk_split(base64_encode(file_get_contents('attachment.zip')));

or use
http://www.codewalkers.com/c/a/Email-Code/PHP-Email-Attachment-v1/

0
 

Author Comment

by:lilyyan
ID: 22880459
Really appreciate you reply! yet it's a little too completed ... : )
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
In this post, we will learn to set up the Group Naming policy and will see how it is going to impact the Display Name and the Email addresses of the Group.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question