• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 270
  • Last Modified:

E-mail excel file as attachment in PHP/ASP.NET or any other technology

hey people,

i want to e-mail an excel file as an attachment using php or asp.net or any other mailing technology will also work.
the main task is that the file is located on the server and it should be sent daily on scheduled time.

any help is useful
  • 3
  • 2
4 Solutions
If the file resides on the SQL Server; Why not create a scheduled task to send an email with the file attached?

Lookup sp_senddbmail
jhawarmayankAuthor Commented:
no its not residing on sql server
the file resides on the server at a location
what i want is that
at a particular time the file is attached and e-mailed to the defined user-id

You can use phpmailer:


Then you need to add a cron job so that it runs the script daily.

Good luck,

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Actually just go to this page: http://phpmailer.codeworxtech.com/index.php?pg=examples 

If you scroll down you can see an example of how to prepare the email.
jhawarmayankAuthor Commented:
this thing is useful
but how do i configure the SMTP server.

You can go here to see the properties you can set: http://phpmailer.codeworxtech.com/index.php?pg=properties

Then you add:
$mail->IsSMTP();  // telling the class to use SMTP  
$mail->Host     = "smtp.example.com:port"; // SMTP server

Then the properties.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now