SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: PHPMailer class

  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHPMailer class

    Hi, i need some help
    I want to use PHPMailer class for sending an email from my PHP script.
    Below is my code :
    Code:
    <?php
    	require("class.phpmailer.php");
    
    	$mail = new PHPMailer();
    
    	$mail->IsMail();
    
    	$mail->AddAddress("cemplukcute2003@yahoo.com","Aileen Pranoto");
    
    	$mail->WordWrap = 50;                              // set word wrap
    	$mail->AddAttachment("./license/license.zip");      // attachment
    	$mail->IsHTML(true);                               // send as HTML
    
    	$mail->Subject  =  "Sig-Share is being tired";
    	$mail->Body     =  "This is the <b>HTML body</b>";
    	$mail->AltBody  =  "This is the text-only body";
    
    	if(!$mail->Send())
    	{
     	  	echo "Message was not sent <p>";
      		echo "Mailer Error: " . $mail->ErrorInfo;
       		exit;
    	}
    	else {
    		echo "Message has been sent";
    	}
    ?>
    It doesn't result any error messages, in fact it will echo Message has been sent. But the problem is i never receive the email @ my yahoo account.
    Can someone help me with this problem, pls?

  2. #2
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Checked your spam folder?
    Tried sending to another address?

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OMG, why i never thinked to checked my spam folder? I feel like an idiot
    Thanks a lot, cranial-bore
    Btw, do you know how to set so the email can be sent to inbox folder and not the spam folder?
    Thanks in advance

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, never mind. I found a way already...
    Thanks again for your help

  5. #5
    SitePoint Member
    Join Date
    Jul 2007
    Location
    Fuzhou,China
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cemplukcute2003 View Post
    Ah, never mind. I found a way already...
    Thanks again for your help
    can I share the solution? thx

  6. #6
    SitePoint Evangelist anjanesh's Avatar
    Join Date
    Jun 2004
    Location
    Mumbai
    Posts
    447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cemplukcute2003 - newer and much more robust php-mailer class : SwiftMailer. Esp if you're using PHP5, it'll do much more (in terms of functionality).
    Anjanesh


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
  •