Sent Mail via SMTP-server: strange size limit 
Author Message
 Sent Mail via SMTP-server: strange size limit

Hi all,
My aim is to send a MIME encoded mail message with text and one
attachment.
First compose the message via imap_mail_compose:
...
         // after creating $body and $envelope ...
        $mailcontent = imap_mail_compose($envelope,$body);
....
Next send via SMTP server:
....
        $stream = fsockopen("localhost",25, &$errno, &$errstr);
        fputs($stream,"EHLO somedomain.net\r\n");


        fputs($stream,"DATA\r\n");
        fputs($stream,$mailcontent);
        fputs($stream,"\r\n.\r\n");
        fputs($stream,"QUIT\r\n");
        fclose($stream);

This WORKS up to a size limit for the whole mail of ~4000 Bytes .... ???

If I increase the mail text or the attachment than no mail is sent
anymore ...
Any clues on this ?
Do I have to 'debug' the mail server, e.g. using fgets() ?

THNX, Roger

--
Dr. Roger Zimmermann *** Institute of Physiology, Hamburg
Martinistra/3e 52 D-20246 Hamburg Tel.: /40 42803 5351
--------------------------------  Fax.: /40 42803 4920
R.Zimmermann=at=Uke.Uni-Hamburg.de // roz=at=snafu.de
PGP-ID:  Roger Zimmermann
KeyPrint=83 16 D1 82 06 71 16 60  6F 61 95 65 BB CA 02 E0



Mon, 30 May 2005 23:54:20 GMT  
 Sent Mail via SMTP-server: strange size limit

Quote:

> This WORKS up to a size limit for the whole mail of ~4000 Bytes .... ???
> If I increase the mail text or the attachment than no mail is sent
> anymore ...

        fputs($stream,"EHLO somedomain.net\r\n");


        fputs($stream,"DATA\r\n");
        fputs($stream,$mailcontent);
        fputs($stream,"\r\n.\r\n");
        fputs($stream,"QUIT\r\n");

i could be wrong on this, but i know that mail() has problems when using
\r\n to separate From/Bcc (for example). Try changing those to \n and see
what happens?

--
----- stephan beal
Registered Linux User #71917 http://counter.li.org
I speak for myself, not my employer. Contents may
be hot. Slippery when wet. Reading disclaimers makes
you go blind. Writing them is worse. You have been Warned.



Tue, 31 May 2005 00:00:10 GMT  
 Sent Mail via SMTP-server: strange size limit

Quote:


> > This WORKS up to a size limit for the whole mail of ~4000 Bytes .... ???
> > If I increase the mail text or the attachment than no mail is sent
> > anymore ...

>         fputs($stream,"EHLO somedomain.net\r\n");


>         fputs($stream,"DATA\r\n");
>         fputs($stream,$mailcontent);
>         fputs($stream,"\r\n.\r\n");
>         fputs($stream,"QUIT\r\n");

> i could be wrong on this, but i know that mail() has problems when using
> \r\n to separate From/Bcc (for example). Try changing those to \n and see
> what happens?

According to RFC2821, to sequence \r\n or CRLF is the official line
terminator ...

BTW:
    1) return status for fputs is always OK, i.e. returns the number of
written chars independent
         wether the mail was sent or was not !
     2) If I send the mailcontent Line-by-Line, the same thing happens ...
:-)

--
Dr. Roger Zimmermann *** Institute of Physiology, Hamburg
Martinistra/3e 52 D-20246 Hamburg Tel.: /40 42803 5351
--------------------------------  Fax.: /40 42803 4920
R.Zimmermann=at=Uke.Uni-Hamburg.de // roz=at=snafu.de
PGP-ID:  Roger Zimmermann
KeyPrint=83 16 D1 82 06 71 16 60  6F 61 95 65 BB CA 02 E0



Tue, 31 May 2005 19:52:03 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. send mail using SMTP Send Message when mail server is unknown

2. Sending mail via an Exchange server

3. sending via smtp (code included)

4. Expect: mailing a file via smtp

5. how to send mail with python using SMTP ?

6. Problem sending mail with tcllib/smtp and mime

7. ezsmtp 1.0 SMTP Mail Sending Library

8. ezsmtp 0.8.0 SMTP Mail Sending Library

9. checking for errors after mail() hands email off to SMTP server

10. SMTPLIB accessing MicroSoft SMTP mail server

11. send ENCRYPED data via E-Mail

12. Sending Mail via outlook

 

 
Powered by phpBB® Forum Software