Solved

how to install php mailer

Posted on 2004-08-27
5
3,403 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
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…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

911 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

17 Experts available now in Live!

Get 1:1 Help Now