Code Comments
Programming Forum and web based access to our favorite programming groups.Hello,
I have an e-mail message in txt file. It contains fields
Subject, To, From, Reply-To,Content-Type, X-Mailer and body.
I want to send the file. I tried this way:
mail('','','',$email_read_into_string);
But I got- Warning: mail(): SMTP server response: 503.
I would rather not parse the file to get fields- Subject, To and From as
separate variables and then use them with mail().
Can I send this file AS-IS?
Regards,
Talthen
Post Follow-up to this messagetalthen.z-serwera.o2@nospam.pl wrote:
> Hello,
> I have an e-mail message in txt file. It contains fields
> Subject, To, From, Reply-To,Content-Type, X-Mailer and body.
> I want to send the file. I tried this way:
> mail('','','',$email_read_into_string);
> But I got- Warning: mail(): SMTP server response: 503.
>
> I would rather not parse the file to get fields- Subject, To and From as
> separate variables and then use them with mail().
> Can I send this file AS-IS?
>
The envelope (headers) are handled quite differently from the body part of
an email. How the entities are encapsulates within files and across
conduits varies. But usually in a text file they are seperated by a blank
line (headers come first). You first need to work out the format of your
"txt" file.
You are getting a 503 error probably because you've not put any recipients
in the message and are trying to insert the mystery encoded message as a
header (param4) which cannot contain blank lines rather than sending it in
the body (param3).
If you are running a local MTA then most provide a command line interface
which will allow you to send a message using an envelope embedded in the
same file as the message (e.g. 'sendmail -t').
C.
Post Follow-up to this message"Colin McKinnon"
<colin.thisisnotmysurname@ntlworld.deletemeunlessURaBot.com>
> You are getting a 503 error probably because you've not put any recipients
> in the message and are trying to insert the mystery encoded message as a
> header (param4) which cannot contain blank lines rather than sending it in
> the body (param3).
Well... my txt e-mail was copied directly from Outlook Express and then all
the data was changed.
As I was told- to problem was, that PHP on Windows just cannot do
mail('','','',$headers), so I have modified it to
mail($from,$subject,'',$headers) and works this way. Not what I wanted, but
afterall it works...
Regards,
Talthen
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.