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

Posted on 2009-02-23
Last Modified: 2012-05-06
hey people,

i want to e-mail an excel file as an attachment using php or 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
Question by:jhawarmayank
    LVL 13

    Accepted Solution

    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

    Author Comment

    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

    LVL 6

    Assisted Solution

    You can use phpmailer:

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

    Good luck,

    LVL 6

    Assisted Solution

    Actually just go to this page:

    If you scroll down you can see an example of how to prepare the email.

    Author Comment

    this thing is useful
    but how do i configure the SMTP server.

    LVL 6

    Assisted Solution

    You can go here to see the properties you can set:

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

    Then the properties.


    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Suggested Solutions

    Part of the Global Positioning System A geocode ( is the major subset of a GPS coordinate (, the other parts being the altitude and t…
    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now