Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Need help ?

  1. #11
    Join Date
    Jul 2006
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hello!

    I know very little bittle about php, its very difficult to learn all ...
    What i know, you give me the code, i can install it ......... please help

    ...........................

  2. #12
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    *sigh* Try this for mail.php
    PHP Code:
    <html>
    <head>
    <title> Sending Email </title>
    </head>
    <body>
    <?php
    // Read POST request params into global vars
    $to      $_POST['to'];
    $from    $_POST['from'];
    $subject $_POST['subject'];
    $message $_POST['message'];

    // Obtain file upload vars
    $fileatt      $_FILES['fileatt']['tmp_name'];
    $fileatt_type $_FILES['fileatt']['type'];
    $fileatt_name $_FILES['fileatt']['name'];

    $headers "From: $from";

    if (
    is_uploaded_file($fileatt)) {
      
    // Read the file to be attached ('rb' = read binary)
      
    $file fopen($fileatt,'rb');
      
    $data fread($file,filesize($fileatt));
      
    fclose($file);

      
    // Generate a boundary string
      
    $semi_rand md5(time());
      
    $mime_boundary "==Multipart_Boundary_x{$semi_rand}x";
      
      
    // Add the headers for a file attachment
      
    $headers .= "\nMIME-Version: 1.0\n" .
                  
    "Content-Type: multipart/mixed;\n" .
                  
    " boundary=\"{$mime_boundary}\"";

      
    // Add a multipart boundary above the plain message
      
    $message "This is a multi-part message in MIME format.\n\n" .
                 
    "--{$mime_boundary}\n" .
                 
    "Content-Type: text/html; charset=\"iso-8859-1\"\n" .
                 
    "Content-Transfer-Encoding: 7bit\n\n" .
                 
    $message "\n\n";

      
    // Base64 encode the file data
      
    $data chunk_split(base64_encode($data));

      
    // Add file attachment to the message
      
    $message .= "--{$mime_boundary}\n" .
                  
    "Content-Type: {$fileatt_type};\n" .
                  
    " name=\"{$fileatt_name}\"\n" .
                  
    //"Content-Disposition: attachment;\n" .
                  //" filename=\"{$fileatt_name}\"\n" .
                  
    "Content-Transfer-Encoding: base64\n\n" .
                  
    $data "\n\n" .
                  
    "--{$mime_boundary}--\n";
    }

    // Send the message
    $ok = @mail($to$subject$message$headers);
    if (
    $ok) {
      echo 
    "<p>Mail sent</p>";
    } else {
      echo 
    "<p>Mail could not be sent. Sorry!</p>";
    }
    ?>
    </body>
    </html>

  3. #13
    Join Date
    Jul 2006
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Hello

    Hello!

    I've tested the above code, mail is sending but not in html (what i want).
    preview of mail is like this:
    here\'s the \"<em>preloaded</em>&nbsp;<b>content</b>\"
    it is not displaying in html in the mail.
    Twey give me following code:

    Code:
    <html>
    <head>
    <title> Sending Email </title>
    </head>
    <body>
    <?php
    // Read POST request params into global vars
    $to      = $_POST['to'];
    $from    = $_POST['from'];
    $subject = $_POST['subject'];
    $message = $_POST['message'];
    
    // Obtain file upload vars
    $fileatt      = $_FILES['fileatt']['tmp_name'];
    $fileatt_type = $_FILES['fileatt']['type'];
    $fileatt_name = $_FILES['fileatt']['name'];
    
    $headers = "From: $from\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; ";
    $headers .= "charset=iso-8859-1\r\n";
    
    if (is_uploaded_file($fileatt)) {
      // Read the file to be attached ('rb' = read binary)
      $file = fopen($fileatt,'rb');
      $data = fread($file,filesize($fileatt));
      fclose($file);
    
      // Generate a boundary string
      $semi_rand = md5(time());
      $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
      
      // Add the headers for a file attachment
      $headers .= "\nMIME-Version: 1.0\n" .
                  "Content-Type: multipart/mixed;\n" .
                  " boundary=\"{$mime_boundary}\"";
    
      // Add a multipart boundary above the plain message
      $message = "This is a multi-part message in MIME format.\n\n" .
                 "--{$mime_boundary}\n" .
                 "Content-Type: html/plain; charset=\"iso-8859-1\"\n" .
                 "Content-Transfer-Encoding: 7bit\n\n" .
                 $message . "\n\n";
    
      // Base64 encode the file data
      $data = chunk_split(base64_encode($data));
    
      // Add file attachment to the message
      $message .= "--{$mime_boundary}\n" .
                  "Content-Type: {$fileatt_type};\n" .
                  " name=\"{$fileatt_name}\"\n" .
                  //"Content-Disposition: attachment;\n" .
                  //" filename=\"{$fileatt_name}\"\n" .
                  "Content-Transfer-Encoding: base64\n\n" .
                  $data . "\n\n" .
                  "--{$mime_boundary}--\n";
    }
    
    // Send the message
    $ok = @mail($to, $subject, $message, $headers);
    if ($ok) {
      echo "<p>Mail sent</p>";
    } else {
      echo "<p>Mail could not be sent. Sorry!</p>";
    }
    ?>
    </body>
    </html>
    & asked me to striplashes it to send mail html, & i don't how to strip slashes it. I've asked him but he is not repyling.

    Please can you solve this.
    I shall be very thankful to you.
    n Thanks alot for replying

    Kaali

  4. #14
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Thumbs up

    In PHP there is a function - stripslash() that returns a string with backslashes stripped off. (\' becomes ' and so on.) Double backslashes (\\) are made into a single backslash (\).

    I've tested the above code, mail is sending but not in html (what i want).
    preview of mail is like this:
    here\'s the \"<em>preloaded</em>&nbsp;<b>content</b>\"
    If you perform a stripslash operation on the above mentioned string which is a part of your PHP code all the back slashes will be removed

    Plz checkout PHP manual if you are having any doubts about stripslash().

  5. #15
    Join Date
    Jul 2006
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy hello

    Hello!

    I've already said! i dont know how do this, I want ready code, just install & run ...

    I'm sorry ! im disturbing you alllll .....

    this my dream ...............

    I wish it come true, but im not seeting to come true ..

    please help

    bye & take care
    thanks for excellent Super B support ..

    Kaali

  6. #16
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    PHP Code:
    <html>
    <head>
    <title> Sending Email </title>
    </head>
    <body>
    <?php
    // Read POST request params into global vars
    $to      $_POST['to'];
    $from    $_POST['from'];
    $subject $_POST['subject'];
    $message $_POST['message'];

    // Obtain file upload vars
    $fileatt      $_FILES['fileatt']['tmp_name'];
    $fileatt_type $_FILES['fileatt']['type'];
    $fileatt_name $_FILES['fileatt']['name'];

    $headers "From: $from\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; ";
    $headers .= "charset=iso-8859-1\r\n";

    if (
    is_uploaded_file($fileatt)) {
      
    // Read the file to be attached ('rb' = read binary)
      
    $file fopen($fileatt,'rb');
      
    $data fread($file,filesize($fileatt));
      
    fclose($file);

      
    // Generate a boundary string
      
    $semi_rand md5(time());
      
    $mime_boundary "==Multipart_Boundary_x{$semi_rand}x";
      
      
    // Add the headers for a file attachment
      
    $headers .= "\nMIME-Version: 1.0\n" .
                  
    "Content-Type: multipart/mixed;\n" .
                  
    " boundary=\"{$mime_boundary}\"";

      
    // Add a multipart boundary above the plain message
      
    $message "This is a multi-part message in MIME format.\n\n" .
                 
    "--{$mime_boundary}\n" .
                 
    "Content-Type: html/plain; charset=\"iso-8859-1\"\n" .
                 
    "Content-Transfer-Encoding: 7bit\n\n" .
                 
    $message "\n\n";

      
    // Base64 encode the file data
      
    $data chunk_split(base64_encode($data));

      
    // Add file attachment to the message
      
    $message .= "--{$mime_boundary}\n" .
                  
    "Content-Type: {$fileatt_type};\n" .
                  
    " name=\"{$fileatt_name}\"\n" .
                  
    //"Content-Disposition: attachment;\n" .
                  //" filename=\"{$fileatt_name}\"\n" .
                  
    "Content-Transfer-Encoding: base64\n\n" .
                  
    $data "\n\n" .
                  
    "--{$mime_boundary}--\n";
    }

    // Send the message
    $ok = @mail($to$subjectstripslashes($message), $headers);
    if (
    $ok) {
      echo 
    "<p>Mail sent</p>";
    } else {
      echo 
    "<p>Mail could not be sent. Sorry!</p>";
    }
    ?>
    </body>
    </html>
    The reason people aren't responding is because you are more interested in us doing it for you than learning how yourself.

  7. #17
    Join Date
    Jul 2006
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking

    HellO!



    I love you : blm126 : & also TWEY without you both this was not possible ...... I luv you alllllllll ......




    The mail is going in HTML ... WOW Unbeleiveable ...... you all ROCK ...



    * the senders name is not coming instead its email address coming, hm ...*

    thanks alotttttt .. luv you

    bye n take care
    Have a nice day!
    KAALI

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
  •