Forum Moderators: coopster
Outlook or whatever mail client you are using does not matter. PHP is managed and interpreted by the server.
Here's a little code to help get you started. The two phpmailer class files contain all of the code for connecting to and authenticating on the mail server. Use proper authentication credentials where indicated.
require("class.phpmailer.php"); require("class.smtp.php"); # SEND MAIL $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "mail.example.com"; $mail->SMTPAuth = true; $mail->Username = [b]'userid'[/b]; $mail->Password = [b]'password'[/b]; $mail->SetLanguage("en","/usr/local/apache/phpmailer/language/"); $mail->From = "sender@example.com"; $mail->FromName = "Sender"; $mail->AddAddress("receiver@example2.com","Receiver"); $mail->Subject = 'Info from Example.com'; $mail->Body = $msg_string; if(!$mail->Send()) { print("Message was not sent <p>"); echo "Mailer Error: " . $mail->ErrorInfo; exit; } In this example, the
$msg_string variable has already been populated with the message to send. I also used hard-coded email addresses (To and From), where I would normally use variables drawn from the form being sent.
Don't forget the official site when looking for help: [phpmailer.sourceforge.net...] . You may also enjoy the extended examples: [phpmailer.sourceforge.net...]
I did look through the links you gave, and in fact over the last 2 months, Ive looked all over their site, but can't seem to find the answers I need.
As mentioned, what are the <b> actual</b> steps to sending an email using phpmailer please? Do you start off in Outlook 2003 and then go to new message? What are the very 1st few steps please?
It seems like you are looking for a solution to deliver formatted email to every mail client, regardless of how the individual user has set up their client.
This is probably not do-able, because when a person has told their client to only view messages in plain text, you're stumped right there.
Your best bet is to compose your message so that it looks perfect (to you) in HTML and looks really cool (to you) when the same message is viewed in plain text without any images or bold text or centering or any other formatting.
There's no easy solution for your problem.
Not quite, just looking to send out multipart mime emails, that, as the name suggests, comes in multipart, 1 part is for plain text and another part is html, if the recipients email client/web interface is set to read in plain text only, then that is how they will view it, but if they have it set to read in html, then they will read the formatted version.
The solution is already out there somewhere - a lot of venues on the web actually discuss it, but I've not come across anywhere, that does a simple step-by-step on it.
Do you just copy and paste the php code into *every* email?
Has anyone found *actual* examples of simple step by steps to doing this start to finish in outlook 2003 anywhere please?
"How do I send email as HTML and plain text in Outlook?"
as opposed to
"How do I send email as HTML and plain text using PHP from the server?"
First, you need to clarify exactly what you are trying to do again for us. Although it seemed like you were originally looking for a PHP mailing solution it seems now as if we may have misunderstood you. If it is the latter you are looking for, a PHP mailing solution, then the answers and examples have already been posted here.
OK, I'm composing and sending emails in Outlook 2003, using the html function, to people who have requested the html emails, but at the recipients end they receive garbled html code - this is despite the fact that Outlook is supposed to send mime multipart emails that should be readable, whether or not the recipients email client/web interface is set to read in plain text or not!!
By Googling for the last few months, it can be seen that some people have solved the problem in Outlook, but fall short of saying how they actually did it!
Question is, has anyone here found a way to always send an html email from Outlook 2003 so that it will always be in a readable format at the other end?
Any help appreciated.
Dexie.
BTW
What is now the PHP problem or question? :)