Send mail using class.phpmailer

Started on the old forum in March 2011 · view the original in the archive · old links redirect here

8 replies · 1,449 views · started 15 years ago · 1 min read

3 participants
atef Developer · 224 posts #1

hi im trying to use class.phpmailer class to send emails but i dosnt work, i used that php code

<?php $id = $_GET['id']; $email = "blackgun2002@yahoo.com"; require("lib/class.phpmailer.php"); $mail = new PHPMailer(); $mail->Host = "localhost"; $mail->From = $id"@yahoo.com"; $mail->FromName = $id"@yahoo.com"; $mail->AddAddress($email); $mail->Subject = "READ"; $mail->Body = "hello my id is $id"; $mail->WordWrap = 50; if(!$mail->Send()) { echo 'Message was not sent.'; echo 'Mailer error: ' . $mail->ErrorInfo; } else { echo ' Mail sent to <? echo $email ?> they will reply within 24 hours,

Your tickt number sent to <? echo $id ?> '; }
?>

please help me with the right code

subzero Super moderator Fellow · 3,954 posts #2

Hello mate.

What are you trying to do ??

Do you wish to plan text emails or html text emails

You do not need stupid mail scripts that needs half of wall of stupid scripts to send 1 piss email...

Added after 22 minutes:

Html Mail sender !

<?php
    $id = $_GET['id'];
    $to = "$id@yahoo.com"; 
    $from = "blackgun2002@yahoo.com"; 

    $subject = "READ"; 

    //begin of HTML message 
    $message = "<html> 
  <body bgcolor=\"#DCEEFC\"> 
    <center> 
        <font color=\"red\">Your id $id!</font> <br> 
        <a href=\"http://YOURSITE/\">* YOURSITE</a> 
    </center> 
      <br><br>*** YOURSITE <br> Regards<br> YOURNAME 
  </body> 
</html>"; 
  
 
    $headers = "MIME-Version: 1.0rn"; 
    $headers .= "Content-type: text/html; charset=iso-8859-1rn"; 
    $headers  .= "From: $from\r\n"; 
    
     
    mail($to, $subject, $message, $headers); 

    echo "Message has been sent....!"; 
?>

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

subzero Super moderator Fellow · 3,954 posts #4

i added the script there 🙂

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

atef Developer · 224 posts #7

please im trying from 3 days at a code same with subzero code but it not changing sender email and tryed mail class and not working too

subzero Super moderator Fellow · 3,954 posts #8

So what you want is

User emails there id to email then there email is 23@yahoo.com and if they send to that mail is thereS?

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close