By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,966 Members | 1,986 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,966 IT Pros & Developers. It's quick & easy.

Sending mail from php script via Outlook

P: 1
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...
Jul 24 '07 #1
Share this Question
Share on Google+
3 Replies


nathj
Expert 100+
P: 938
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.
Jul 24 '07 #2

pbmods
Expert 5K+
P: 5,821
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?).
Jul 24 '07 #3

nathj
Expert 100+
P: 938
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
Jul 25 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.