SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: PHPMaikler?

  1. #1
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,644
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    PHPMaikler?

    I have a form which I would like to use PHPMailer to send me emails. Right now, im trying to test to see if I can use it (by creating a mail_test.php)
    Its code
    PHP Code:
    <?php
    require("/phpmailer/mail.inc.php");

    // Instantiate your new class
    $mail = new MyMailer;

    // Now you only need to add the necessary stuff
    $mail->AddAddress("support@lvasp.com""LVASP Admin.");
    $mail->Subject "Here is the subject";
    $mail->Body    "This is the message body";
    $mail->AddAttachment("C:\Documents and Settings\Luke\Desktop\gangstadog.jpg"); 

    if(!
    $mail->Send())
    {
       echo 
    "There was an error sending the message";
       exit;
    }

    echo 
    "Message was sent successfully";
    ?>
    Its at http://www.lvasp.com/mail_test.php

    So I gather my path for the require statement is the problem.
    I did upload the whole application into the /phpmailer directory on my servers root. I am lost as to where to go from here?
    Help?
    Thanks...
    "Oh, and Jenkins--apparently your mother died this morning."

  2. #2
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my mobile portal
    ghiris.ro

  3. #3
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,644
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    is it ok if I modified the reguire statement?ok, like this?
    PHP Code:

    <?php

    require("/phpmailer/class.phpmailer.php");

    $mail = new PHPMailer();
    $mail->IsSMTP();    // telling the class to use SMTP
    $mail->Host "smtp.lvasp.com"// SMTP server
    $mail->From "support@lvasp.com";
    $mail->AddAddress("support@lvasp.com""LVASP Admin.");
    $mail->Subject "first mailing";
    $mail->Body "hi ! \n\n this is First mailing I made myself with PHPMailer !";
    $mail->AddAttachment("C:\Documents and Settings\Luke\Desktop\gangstadog.jpg"); 
    if(!
    $mail->Send())
    {
       echo 
    "Message was not sent";
       echo 
    "Mailer Error: " $mail->ErrorInfo;
    }
    else
    {
       echo 
    "Message has been sent";
    }
    ?>
    "Oh, and Jenkins--apparently your mother died this morning."

  4. #4
    Resident Code Monkey Chris Corbyn's Avatar
    Join Date
    Nov 2005
    Location
    Melbourne, Australia
    Posts
    713
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you need that first slash? The slash could be causing problems if the "phpmailer" directory is not right at the root of that hard disk.

    PHMailer also went out of development in 2005 and is not up-to-date with current technologies. Swift Mailer is however up-to-date and still in development (as well as being 3 times faster).
    Last edited by Chris Corbyn; Aug 5, 2007 at 06:41. Reason: Incorrect information (2005 was written 2004)

  5. #5
    SitePoint Wizard wheeler's Avatar
    Join Date
    Mar 2006
    Location
    Gold Coast, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    only one way to find out...

    I recommend swiftmailer instead of phpmailer too its a bit more simple and flexible.
    Studiotime - Time Management for Web Developers
    to-do's, messages, invoicing, reporting - 30 day free trial!
    Thomas Multimedia Web Development


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •