Solved

how to install php mailer

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WSDL Soap Error 12 281
Share post from Facebook Tab Application 6 42
Windows Standards for file storage. 3 31
Does a Google search find images with the word being searched? 11 84
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
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…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

820 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