?
Solved

how to install php mailer

Posted on 2004-08-27
5
Medium Priority
?
3,472 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
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…

719 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