Advanced email in PHP

followup… we all know how you can sendmail via PHP, but how do you RECEIVE email via php?

it’s a good tutorial thx

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

Is there an htm example that uses the above? I feel that I’m lacking the attached file naming process.

problems with getting this to work on a shared server running cpanel.

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?

This does not send if smtp server requires authentication

Great article. I’ve looked at a couple of different PHP books on the mail topic and they were not even close to being as detailed as in this article.

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?

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.

excellent article.

thank you

it will not work with linux server. i think you have to use
\r at the end of each line in header. and it will work then

Great! I will try this on my next form

nice

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}
" .
“Content-Type: {$fileatt_type};
" .
" name=\”{$fileatt_name}\”
" .
“Content-Disposition: attachment;
" .
" filename=\”{$fileatt}\"
" .
"Content-Transfer-Encoding: base64

" .
$data . "

" .
"–{$mime_boundary}–
";
}

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 :slight_smile:

Cheers
Dal

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?

really helpful - thanks. Certainly not winging, but any chance of going into SMTP mail?

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.