Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

How to send an e-mail file?
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



Report this thread to moderator Post Follow-up to this message
Old Post

04-30-06 11:58 PM


Re: How to send an e-mail file?
talthen.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.

Report this thread to moderator Post Follow-up to this message
Old Post
Colin McKinnon
05-08-06 12:01 AM


Re: How to send an e-mail file?
"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



Report this thread to moderator Post Follow-up to this message
Old Post

05-08-06 12:01 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:10 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.