Solved

how to install php mailer

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
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…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

813 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

11 Experts available now in Live!

Get 1:1 Help Now