Sending mail from php script via Outlook

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nast775
    New Member
    • Jul 2007
    • 1

    #1

    Sending mail from php script via Outlook

    hi,

    i'm new here and to php so I hope you will excuse me if I'm asking the questions you already answered before :)

    I have some small task which is the following:
    We have WiKi page, I created the form. I would like the following:
    then somebody presses submit button, script updates WiKi page (already done), shows on the screen formated input and then - I would like to send mail (better in HTML format)
    1. I would like to be able to add colors to that mail - is it possible?
    2. I would like to send this mail via Outlook (e.g. I want my form to open Outlook and show the sender how his mail looks like. Sender should press "Send" button)

    Is it possible? How can I do this?

    thank you in advance...
  • nathj
    Recognized Expert Contributor
    • May 2007
    • 937

    #2
    Originally posted by nast775
    hi,

    i'm new here and to php so I hope you will excuse me if I'm asking the questions you already answered before :)

    I have some small task which is the following:
    We have WiKi page, I created the form. I would like the following:
    then somebody presses submit button, script updates WiKi page (already done), shows on the screen formated input and then - I would like to send mail (better in HTML format)
    1. I would like to be able to add colors to that mail - is it possible?
    2. I would like to send this mail via Outlook (e.g. I want my form to open Outlook and show the sender how his mail looks like. Sender should press "Send" button)

    Is it possible? How can I do this?

    thank you in advance...
    Generally it is a bad idea to code for a specific application, not all your users will have Outlook installed.

    It seems to me that PHPMailer may be the answer to your needs.

    I have had a look at this recently and will be deploying similar functionality using PHPMailer in the near future.

    The best thing to do is read up on PHPMailer and have a go, then post any specific questions and code for further help.

    Cheers
    nathj

    PS - on the link I give you may have to scroll down a way to see the tutorial.

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      Heya, nast775. Welcome to TSDN!

      To add HTML to your email, you have to set a couple of headers. Check out this example.

      In terms of opening outlook, remember that PHP is server-side. You can't do anything in PHP that affects the state of the User's computer.

      You can try posting this in the JavaScript forum, but short of using something extremely proprietary, I'm afraid you're not going to find what you're looking for (besides, what if the User prefers Thunderbird or has a Mac?).

      Comment

      • nathj
        Recognized Expert Contributor
        • May 2007
        • 937

        #4
        Originally posted by pbmods
        Heya, nast775. Welcome to TSDN!

        To add HTML to your email, you have to set a couple of headers. Check out this example.

        In terms of opening outlook, remember that PHP is server-side. You can't do anything in PHP that affects the state of the User's computer.

        You can try posting this in the JavaScript forum, but short of using something extremely proprietary, I'm afraid you're not going to find what you're looking for (besides, what if the User prefers Thunderbird or has a Mac?).
        I think there may be some issues with the standard mail() functions as I tried using them as the sample suggests and the HTML code was just printed as the body part of the email.

        I am prepared to admit that it was likely I got it wrong, but from what I have read it is worth pursuing the PHPMailer() class if at all possible.

        It may also have been the mail client I was using from the host to receive the HTML emails - this is always a possibility. The advanage that PHPMailer() has is that you can set the HTML body and set and alterntive body for text only.

        One thing we are all agreed on is that you shouldn't really code for something as a specific as an email client.

        If you do get what you are after with the mail() function then let me know as I would love to see how you get it working. My previous project was reverted to go old text only emails, fine for it's purposes but the current project will need to be a bit more fancy.

        Cheers
        nathj
        Last edited by nathj; Jul 25 '07, 07:30 AM. Reason: adding info

        Comment

        Working...