SitePoint Sponsor

User Tag List

Page 3 of 4 FirstFirst 1234 LastLast
Results 51 to 75 of 78
  1. #51
    Non-Member
    Join Date
    Feb 2005
    Posts
    737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Guys,

    Great tutorial and have got mine working, but is there any way that the email will let you send an attachment that is more than 1 meg? If it's over 1 meg my page just throws a wobbily and kicks you out when you hit submit? Can it be created to send several meg for example?

    Thanks

    Chris

  2. #52
    $this->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Dec 2003
    Location
    Federal Way, Washington (USA)
    Posts
    1,526
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The email attachment size limit has more to do with the settings on your email client than with this script.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    Showcase your music collection on the Web

  3. #53
    Hardeep
    SitePoint Community Guest
    How to read contents of the email, when u receive an email...

  4. #54
    Non-Member
    Join Date
    Feb 2005
    Posts
    737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Guys,

    This is strange. I've got it working now so it sends anything under 1mb with an attachment.

    But it it's over 1mb there is no attachment and there is nothing with the email - even though it takes ages to go when you press the send button?

    Any ideas thanks?

    HTML Code:
    <html>
    <head>
    <title>Send us your design brief</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="main.css">
    </head>
    
    <body bgcolor="#FFFFFF">
    <form action="mail.php" method="POST" enctype="multipart/form-data">
      <table width="80%" border="0" align="center" class="dotted" height="677">
        <tr>
          <td> 
            <p>&nbsp;</p>
            <table width="94%" cellspacing="0" cellpadding="0" align="center">
              <tr> 
                <th colspan="5" background="images/top.jpg"> 
                  <div align="left"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><img src="images/design_3.jpg" width="717" height="46"> 
                    </b></font></div>
                </th>
              </tr>
              <tr valign="top"> 
                <td rowspan="4" width="26%"> 
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td class="maintext"><img src="images/1.gif" width="114" height="24"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b> 
                        </b></font></td>
                    </tr>
                    <tr> 
                      <td><font face="Arial, Helvetica, sans-serif" size="3"><b>1a. 
                        Your Name:</b></font></td>
                    </tr>
                    <tr> 
                      <td> 
                        <input type="text" name="your_name" class="box" size="20" value="" />
                      </td>
                    </tr>
                    <tr> 
                      <td>&nbsp;</td>
                    </tr>
                    <tr> 
                      <td><font face="Arial, Helvetica, sans-serif" size="3"><b>1b. 
                        Centre (ie Paisley etc)</b></font></td>
                    </tr>
                    <tr> 
                      <td> 
                        <input type="text" name="your_centre" class="box" size="20" value="" />
                      </td>
                    </tr>
                    <tr> 
                      <td>&nbsp;</td>
                    </tr>
                    <tr> 
                      <td><font face="Arial, Helvetica, sans-serif" size="3"><b>1c. 
                        Your Telephone</b></font></td>
                    </tr>
                    <tr> 
                      <td> 
                        <input type="text" name="your_telephone" class="box" size="20" value="" />
                      </td>
                    </tr>
                    <tr> 
                      <td>&nbsp;</td>
                    </tr>
                    <tr> 
                      <td><font size="3"><b><font face="Arial, Helvetica, sans-serif">1d. 
                        Your Email</font></b></font></td>
                    </tr>
                    <tr> 
                      <td> 
                        <input type="text" name="from" class="box" size="20" value="" />
                      </td>
                    </tr>
                    <tr> 
                      <td>&nbsp;</td>
                    </tr>
                    <tr> 
                      <td><img src="images/2.gif" width="176" height="24"></td>
                    </tr>
                    <tr> 
                      <td><font face="Arial, Helvetica, sans-serif" size="3"><b>2a. 
                        Client name:</b></font></td>
                    </tr>
                    <tr> 
                      <td> 
                        <input type="text" name="client_name" class="box" size="20" value="" />
                      </td>
                    </tr>
                    <tr> 
                      <td>&nbsp;</td>
                    </tr>
                    <tr> 
                      <td><font face="Arial, Helvetica, sans-serif" size="3"><b>2b. 
                        Client history</b></font></td>
                    </tr>
                    <tr> 
                      <td> 
                        <table width="80%" border="0" cellspacing="0" cellpadding="0" class="box">
                          <tr> 
                            <td colspan="2" valign="top" height="22"> 
                              <input type="radio" name="client" value="Current Client">
                              Current Client <br>
                              <input type="radio" name="client" value="New Client">
                              New Client <br>
                              <input type="radio" name="client" value="Prospective Client">
                              Prospective Client</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
                <td rowspan="4" width="1%"><img src="blank.gif" width="15" height="30"></td>
                <td rowspan="4" width="32%"> 
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td class="maintext"><img src="images/3.gif" width="186" height="24"></td>
                    </tr>
                    <tr> 
                      <td><font face="Arial, Helvetica, sans-serif" size="3"><b>3a. 
                        Sizes required</b></font></td>
                    </tr>
                    <tr> 
                      <td> 
                        <input type="text" name="sizes_required" class="box" size="20" value="" />
                      </td>
                    </tr>
                    <tr> 
                      <td>&nbsp;</td>
                    </tr>
                    <tr> 
                      <td><font face="Arial, Helvetica, sans-serif" size="3"><b>3b. 
                        Proof required by</b></font></td>
                    </tr>
                    <tr> 
                      <td> 
                        <input type="text" name="proof_required_by" class="box" size="20" value="" />
                      </td>
                    </tr>
                    <tr> 
                      <td>&nbsp;</td>
                    </tr>
                    <tr> 
                      <td><font face="Arial, Helvetica, sans-serif" size="3"><b>3c. 
                        Colour specification</b></font></td>
                    </tr>
                    <tr> 
                      <td height="60">
                        <table width="80%" border="0" cellspacing="0" cellpadding="0" class="box">
                          <tr> 
                            <td colspan="2"> 
                              <div align="left"> 
                                <input type="radio" name="colour" value="Mono">
                                Mono</div>
                              <div align="left"> 
                                <input type="radio" name="colour" value="Spot Colour">
                                Spot Colour</div>
                              <div align="left"> 
                                <input type="radio" name="colour" value="Full Colour">
                                Full Colour</div>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr> 
                      <td height="6">&nbsp;</td>
                    </tr>
                    <tr> 
                      <td> 
                        <p><font face="Verdana, Arial, Helvetica, sans-serif" size="3"><b><font face="Arial, Helvetica, sans-serif">3d. 
                          Please attach any documents:</font></b></font> </p>
                        <p> 
                          <input type="file" name="fileatt" />
                          <input type="file" name="fileatt2" />
                          <input type="file" name="fileatt3" />
                        </p>
                        </td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                    </tr>
                    <tr> 
                      <td height="27"><font face="Verdana, Arial, Helvetica, sans-serif" size="3"><b><font face="Arial, Helvetica, sans-serif">3e. 
                        I have attached the following:</font></b></font></td>
                    </tr>
                    <tr valign="top"> 
                      <td height="176"> 
                        <table width="80%" border="0" cellspacing="0" cellpadding="0" class="box">
                          <tr> 
                            <td width="10%" valign="top"> 
                              <input type="checkbox" name="artwork_and_logos_attached" value="Yes" />
                            </td>
                            <td width="90%" class="small_text"> 
                              <div align="left">Artwork/Logos</div>
                            </td>
                          </tr>
                          <tr> 
                            <td width="10%" valign="top"> 
                              <input type="checkbox" name="previous_ad_attached" value="Yes" />
                            </td>
                            <td width="90%" class="small_text"> 
                              <div align="left">Previous Ad</div>
                            </td>
                          </tr>
                          <tr> 
                            <td width="10%" valign="top"> 
                              <input type="checkbox" name="rough_outline_attached" value="Yes" />
                            </td>
                            <td width="90%" class="small_text"> 
                              <div align="left">Rough Outline</div>
                            </td>
                          </tr>
                          <tr> 
                            <td width="10%" valign="top"> 
                              <input type="checkbox" name="hard_copy_reference_attached" value="Yes" />
                            </td>
                            <td width="90%" class="small_text">Hard Copy Reference</td>
                          </tr>
                          <tr> 
                            <td width="10%" valign="top" height="8"> 
                              <input type="checkbox" name="other_attached" value="Yes">
                            </td>
                            <td width="90%" class="small_text" height="8">Other - 
                              Please include details </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
                <td rowspan="4" width="1%"><img src="blank.gif" width="15" height="30"></td>
                <td rowspan="4" width="40%"> 
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr valign="top"> 
                      <td class="maintext" height="2"><img src="images/4.gif" width="138" height="24"></td>
                    </tr>
                    <tr valign="top"> 
                      <td height="2"><font face="Arial, Helvetica, sans-serif" size="3"><b>Please 
                        specify any other information you think may be useful to the 
                        designer e.g. company colours (Pantone colours etc.), imagery, 
                        service company provides, brief history of relationship with 
                        us, client website address etc.</b></font></td>
                    </tr>
                    <tr valign="top"> 
                      <td class="maintext" height="408"> 
                        <div align="center"> 
                          <textarea name="other_details" class="box" cols="32" rows="19" /></textarea>
                          <br>
                          <br>
                          <input type="submit" name="Submit" value="Submit form" class="buttons">
                          <input type="reset" name="Submit2" value="Reset form" class="buttons">
                        </div>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr valign="top"></tr>
              <tr valign="top"></tr>
              <tr> </tr>
            </table>
            <br>
            <table width="72%" cellspacing="0" cellpadding="0" align="center">
            </table>
            <table width="94%" border="0" cellspacing="1" cellpadding="1" align="center" background="images/bottom_bit.jpg">
              <tr> 
                <td> 
                  <div align="left"><img src="images/bottom.jpg" width="285" height="48" border="0"></div>
                </td>
              </tr>
            </table>
            <br>
          </td>
        </tr>
      </table>
      <p>&nbsp;</p>
    </form>
    <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b> </b></font> 
    </body>
    </html>
    php mail code:

    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']; 

    $to="me@me.co.uk"
    $subject="Design Request form"
    $your_name $_POST['your_name']; 
    $your_centre $_POST['your_centre']; 
    $your_telephone $_POST['your_telephone']; 
    $client_name $_POST['client_name']; 
    $client $_POST['client']; 
    $sizes_required $_POST['sizes_required']; 
    $proof_required_by $_POST['proof_required_by']; 
    $colour $_POST['colour']; 
    $artwork_and_logos_attached $_POST['artwork_and_logos_attached']; 
    $previous_ad_attached $_POST['previous_ad_attached']; 
    $rough_outline_attached $_POST['rough_outline_attached'];   
    $hard_copy_reference_attached $_POST['hard_copy_reference_attached']; 
    $other_attached $_POST['other_attached']; 
    $other_details $_POST['other_details']; 

    if (!empty(
    $your_name)) { 
    $message .= 'Your Name: '$your_name ."\n\n";

    if (!empty(
    $your_centre)) { 
    $message .= 'Your Centre: '$your_centre ."\n\n";

    if (!empty(
    $your_telephone)) { 
    $message .= 'Your Telephone: '$your_telephone ."\n\n";

    if (!empty(
    $client_name)) { 
    $message .= 'Client Name: '$client_name ."\n\n"

    if (!empty(
    $client)) { 
    $message .= 'Client Type: '$client ."\n\n";

    if (!empty(
    $sizes_required)) { 
    $message .= 'Sizes Required: '$sizes_required ."\n\n";

    if (!empty(
    $proof_required_by)) { 
    $message .= 'Proof Required by: '$proof_required_by ."\n\n";

    if (!empty(
    $colour)) { 
    $message .= 'Advert Colour: '$colour ."\n\n"

    if (!empty(
    $artwork_and_logos_attached)) { 
    $message .= 'Artwork or Logos attached: '$artwork_and_logos_attached ."\n\n";

    if (!empty(
    $previous_ad_attached)) { 
    $message .= 'Previous Ad Attached: '$previous_ad_attached ."\n\n";

    if (!empty(
    $rough_outline_attached)) { 
    $message .= 'Rough Outline Attached: '$rough_outline_attached ."\n\n"

    if (!empty(
    $hard_copy_reference_attached)) { 
    $message .= 'Hard Copy Reference Attached: '$hard_copy_reference_attached ."\n\n";

    if (!empty(
    $other_attached)) { 
    $message .= 'Other Attached: '$other_attached ."\n\n"

    if (!empty(
    $other_details)) { 
    $message .= 'Other details: '$other_details ."\n\n";



    // Obtain file upload vars
    $fileatt        $_FILES['fileatt']['tmp_name'];
    $fileatt_type    $_FILES['fileatt']['type'];
    $fileatt_name    $_FILES['fileatt']['name'];
    $fileatt2        $_FILES['fileatt2']['tmp_name'];
    $fileatt_type2    $_FILES['fileatt2']['type'];
    $fileatt_name2    $_FILES['fileatt2']['name'];
    $fileatt3        $_FILES['fileatt3']['tmp_name'];
    $fileatt_type3    $_FILES['fileatt3']['type'];
    $fileatt_name3    $_FILES['fileatt3']['name'];

    $headers "From: $from";

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

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

      if (
    is_uploaded_file($fileatt2)) {
          
    $file2 fopen($fileatt2,'rb');
          
    $data2 fread($file2,filesize($fileatt2));
          
    fclose($file2);

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

      if (
    is_uploaded_file($fileatt3)) {
          
    $file3 fopen($fileatt3,'rb');
          
    $data3 fread($file3,filesize($fileatt3));
          
    fclose($file3);

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

      
    // 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/plain;\n charset=\"iso-8859-1\"\n" .
                 
    "Content-Transfer-Encoding: 7bit\n\n" .
                 
    $message "\n\n" .
                 
    "--{$mime_boundary}\n";

      
    // Add file attachment(s) to the message
      
    if ($fileatt_name "") {
          
    $message .= "Content-Type: {$fileatt_type};\n" .
                      
    " name=\"{$fileatt_name}\"\n" .
                      
    "Content-Transfer-Encoding: base64\n" .
                        
    "Content-Disposition: attachment;\n" .
                        
    " filename=\"{$fileatt_name}\"\n\n" .
                      
    $data "\n" .
                      
    "--{$mime_boundary}\n";
        }
        
        
      if (
    $fileatt_name2 "") {
          
    $message .=  "Content-Type: {$fileatt_type2};\n" .
                      
    " name=\"{$fileatt_name2}\"\n" .
                      
    "Content-Transfer-Encoding: base64\n" .
                        
    "Content-Disposition: attachment;\n" .
                        
    " filename=\"{$fileatt_name2}\"\n\n" .
                      
    $data2 "\n" .
                      
    "--{$mime_boundary}\n";
        }
        
        
      if (
    $fileatt_name3 "") {
          
    $message .=  "Content-Type: {$fileatt_type3};\n" .
                      
    " name=\"{$fileatt_name3}\"\n" .
                      
    "Content-Transfer-Encoding: base64\n" .
                        
    "Content-Disposition: attachment;\n" .
                        
    " filename=\"{$fileatt_name3}\"\n\n" .
                      
    $data3 "\n" .
                      
    "--{$mime_boundary}";
        }
        
    $message .=  "--\n\n";    
    }

    // Send the message
    $ok = @mail($to$subject$message$headers);
    if (
    $ok) {
      echo 
    "<p>Thank you.  An email has been sent to our Design Team who will be in touch with you shortly.</p>";
    } else {
      echo 
    "<p>Mail could not be sent. Sorry!</p>";
    }
    ?> 
    </body>
    </html>
    Thanks

  5. #55
    PEACE WILL WIN abalfazl's Avatar
    Join Date
    Feb 2005
    Location
    Beyond the seas there is a town
    Posts
    711
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello firends

    Good articles about emails in PHP:

    http://www.zend.com/zend/spotlight/s...emailpart1.php

    I think that ,It was better that article explains more about MIME.

    GOOD LUCK!

  6. #56
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    XPertMailer is a PHP class that you can use to send encoded MIME type e-mail messages (text, HTML, HTML embedded images, attachments) towards a localhost, client or relay SMTP servers with optional authorisation. Cc and Bcc functionality are included.
    The XPertMailer class functions are optimised to execute in a very small time and allso to be easy to use. This reduces the size of the code and the time required to write it.
    The names of the public functions in the XPertMailer class are eloquent so that they can be used without any confusions being made.
    The data sendig is done according to the RFC 821 and RFC 2821, and the message type is in conformity with the RFC 2045, RFC 2046, RFC 2047, RFC 2048, RFC 2049, and RFC 2822.

    You can do all you want with a few lines of the code, like this example:

    PHP Code:
    <?php

    set_time_limit
    (0);

    // optionaly, you can disable display errors
    error_reporting(false); // from php (generally)
    define('PRINT_ERROR'false); // from XPertMailer class

    // path to XPertMailer class file
    require_once 'XPertMailer.php';

    /**
     * send to multiple e-mail addresses - text/html format
     * with two HTML embedded images and two attachment files
     * --------------------------------------
     */

    // you can optionaly use an relay host name, if fail, send directly to the client
    $mail = new XPertMailer(SMTP_RELAY_CLIENT'relay-host-name.com');

    // set authentication username and password for relay host and auth type (here AUTH_LOGIN, by default is AUTH_DETECT)
    $mail->auth('username''password'AUTH_LOGIN);

    // optionaly, set the port number value for SMTP server socket connections, default are 25
    $mail->port(25);

    // optionaly, set time out for SMTP server socket connections (in secounds), default are 10
    $mail->timeout(30);

    // set priority high (default is normal)
    $mail->priority(P_HIGH);

    // set from mail address and optionaly from name
    $mail->from('my@account.com''My Name');

    // set each header name and value
    $header['Cc'] = 'user1@example1.com, anotheruser1@example2.com';
    $header['Bcc'] = 'user2@example3.com, anotheruser2@example4.com';
    $header['Reply-To'] = 'reply@domain.com';
    $header['X-Whatever'] = 'description';

    // set additional header informations
    $mail->headers($header);

    // set HTML embedded images name and optionaly you can rename them
    // if the file is not in this directory, write the path name (/path/name.image_extension)
    // Attention: do not include path name in the rename file like /path/rename.gif, put only rename.gif
    $imgs[] = 'image1.jpg';
    $imgs['rename.gif'] = 'image2.gif';

    // attach HTML embedded images
    $mail->attach($imgsATTACH_HTML_IMG);

    // set attachment files name and optional you can rename them
    // if the file is not in this directory, write the path name (/path/name.file_extension)
    $file['new.zip'] = 'archive1.zip';
    $file[] = 'archive2.tar.gz';

    // attach files
    $mail->attach($fileATTACH_FILE);

    // set html value
    // Attention: do not include image path name in HTML source like <img src="/path/name.jpg">, put only <img src="name.jpg">
    $html '<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
    <html>
    <body>
    <img src="image1.jpg" border="0"><br>
    <b><u><i>next image</i></u></b> :-)<br>
    <img src="rename.gif" border="2"><br>
    <font color="red">message html red here</font>
    </body>
    </html>'
    ;

    // send to multiple e-mail addresses and optionaly you can set charset value (here UTF-8, by default is ISO-8859-1)
    // as you can see, the text/plain message is required because not all mail clients can currently support HTML messages
    $send $mail->send('touser@domain1.com, toanotheruser@domain2.com''subject here''text version'.CRLF.'new line'$html'UTF-8');

    // compare the result and print a message
    echo $send "Done." "Error.";

    // some useful for debugging
    echo "<br>Server response: ".$mail->response;

    ?>
    Enjoy www.xpertmailer.com
    Last edited by expertphp; Jan 31, 2006 at 02:45.

  7. #57
    SitePoint Zealot MrDiaz's Avatar
    Join Date
    Dec 2005
    Location
    Ontario, Canada
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <self promo>
    Last edited by Rick; Oct 1, 2006 at 05:38.
    My Website:
    www.planetdiaz.com

  8. #58
    SitePoint Zealot crunch42's Avatar
    Join Date
    Jun 2003
    Location
    San Francisco
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's some good info about securing forms from email injection attacks: http://www.securephpwiki.com/index.php/Email_Injection

  9. #59
    *********! *********!!! jackli's Avatar
    Join Date
    Sep 2005
    Posts
    436
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    followup... we all know how you can sendmail via PHP, but how do you RECEIVE email via php?

  10. #60
    gaby
    SitePoint Community Guest
    it's a good tutorial thx

  11. #61
    gaby
    SitePoint Community Guest
    it's me again... i have a little problem
    there is possible to send a HTML page?
    or only a picture?? but when open the message to see it not to download it(same for the HTML page if is possible) ... thx again

  12. #62
    Robert Poland
    SitePoint Community Guest
    Is there an htm example that uses the above? I feel that I'm lacking the attached file naming process.

  13. #63
    *********! *********!!! jackli's Avatar
    Join Date
    Sep 2005
    Posts
    436
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    problems with getting this to work on a shared server running cpanel.

  14. #64
    alex
    SitePoint Community Guest
    i'm using the script provided here for sending an e-mail attachment, but it doesn't work :((
    (no error message, absolutely nothing when the script is run: http://oscius.3x.ro/index.html )
    ... and the server has the php mail() function enabled. what any other reason could be for that?

  15. #65
    omar
    SitePoint Community Guest
    This does not send if smtp server requires authentication

  16. #66
    http://www.isquaretechnologies.com
    SitePoint Community Guest
    I think it will not work when there is authentication set to SMTP server. Is it? Please let me know.. When can I set the SMTP username and password?

  17. #67
    Kodosai
    SitePoint Community Guest
    This does work when you are dealing with same domain emails. i.e. the email address you are sending to is the same domain as the server you are sending from (webserver) and the same domain as the mail server. You will need to find some other 3rd party mail handling code to handle smtp authentication to go inter-domain.

  18. #68
    shahid
    SitePoint Community Guest
    excellent article.

    thank you

  19. #69
    Aaqib
    SitePoint Community Guest
    it will not work with linux server. i think you have to use \n\r at the end of each line in header. and it will work then

  20. #70
    SitePoint Enthusiast
    Join Date
    Feb 2008
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great! I will try this on my next form

  21. #71
    Jenia
    SitePoint Community Guest
    nice

  22. #72
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've just started using your help doc (thank you, just what I needed) however can I point out that the filename comes up as the address so I changed the code supplied to the once below;

    // 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}\"\n" .
    "Content-Transfer-Encoding: base64\n\n" .
    $data . "\n\n" .
    "--{$mime_boundary}--\n";
    }

    and it worked fine after that... just working on getting mime type as I've already got the image file I want to send sitting on the server (user uploads elsewhere) but php's filetype() function isn't working ... may have something to do with the path I'm using so I'll keep at it.

    Thanks again for the help, excellent documentation :)

    Cheers
    Dal

  23. #73
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I used this code and all document type (doc, docx, xml, txt, etc) files are blank. The file name is correct, the file size is correct, but there is not text. I tested the supplied code from the tut and it does the same thing. Any ideas?

  24. #74
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    really helpful - thanks. Certainly not winging, but any chance of going into SMTP mail?

  25. #75
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    BTW my issue came from a problem on my company's server with the php.ini file. I had to house the php file offsite.


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
  •