Solved

how to install php mailer

Posted on 2004-08-27
5
3,385 Views
Last Modified: 2008-01-09
hi, i tried to run a script which uses php mailer, but I get this message.....

Warning: main(class.phpmailer.php): failed to open stream: No such file or directory in /home

Now do I ask my web host to install it on the server or is it something that I have to do?
0
Comment
Question by:skylabel
  • 3
  • 2
5 Comments
 
LVL 1

Author Comment

by:skylabel
ID: 11910994
...Meanwhile, I'm using the mail function....Is there anyway to include a 'to' name instead the email address?
0
 
LVL 1

Author Comment

by:skylabel
ID: 11911007
...sorry, just related....is there also a way to include alt text using mail, in case recipient's client has html turned off.....
0
 
LVL 49

Accepted Solution

by:
Roonaan earned 500 total points
ID: 11911022
Re: 'is there anyway to include a 'to'name instead the email address?'

You can add Additional mailheaders and thereby adding a 'to'-name using the "name <emailaddress@domain>" syntax:

Don't forget to add the "\r\n" at the end of each header line.

/* additional headers */
$headers  = "To: Mary <mary@example.com>, Kelly <kelly@example.com>\r\n";
$headers .= "From: Birthday Reminder <birthday@example.com>\r\n";
$headers .= "Cc: birthdayarchive@example.com\r\n";
$headers .= "Bcc: birthdaycheck@example.com\r\n";

/* and now mail it */
mail($to, $subject, $message, $headers);

-r-
0
 
LVL 49

Assisted Solution

by:Roonaan
Roonaan earned 500 total points
ID: 11911055
I use this class found somewhere on the web, but cannot trace the origin:

class multimail
{
  function mail($from, $to, $subject, $text, $html)
  {
    $headers = '';
    $headers .= "FROM: $from\n";
    $headers .= "Reply-To: $from\n";
   
    // This is the important part!
    // This content type identifies the content of the message.
    // The boundary delimits the plain text and html sections.
    // The value of the boundary can be anything - you can even use the same one we used here
    $headers .= "Content-Type: multipart/alternative;boundary=\"XX-1234DED00099A\";\nContent-Transfer-Encoding: 7bit\n\nThis is a MIME encoded message\n\n";
    // Now begin your message, starting with the delimiter we specified in the boundary
    // Notice that two extra dashes (--) are added to the delimiters when
    // They are actually being used.
    $message = "--XX-1234DED00099A\nContent-Type: text/plain; charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\n$text\n\n";
    // Now begin your HTML message, starting with the delimiter
    // Also notice that we add another content-type line which
    // lets the mail client know to render it in HTML
    $message .= "--XX-1234DED00099A\nContent-Type: text/html; charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\n$html\n\n--XX-1234DED00099A";
   
    // Now send the mail.
    // The additional header, "-f invites@yourbigevents.com" is only required by
    // some configurations.
    //echo '<div><h1>Html</h1>'.$html.'</div>';
    //echo '<div><h1>Text</h1><pre>'.htmlspecialchars($text).'</pre></div>';
    //return true;
    return @mail($to, $subject, $message ,$headers/*,"-f ".$from*/);
  }
}

Call it as

mullimail::mail('from', 'to', 'subject', 'textbody','htmlbody');
0
 
LVL 1

Author Comment

by:skylabel
ID: 11913542
Thanks...anyways for alt text for non-html enabled email clients??
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
RSS Feeds--IE 13 151
Format results with PHP 3 61
How to analyze web traffic logs 10 90
cookies analysis tools 2 29
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

760 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

21 Experts available now in Live!

Get 1:1 Help Now