|
użytkowników online: 17
|
OPINIE UŻYTKOWNIKÓW
|
Porady zamieszczone tutaj przez Darka są pomocne w wielu chwilach. Wielokrotnie tworząc jakiś złożony serwis korzystam z tych porad. Można by tworzyć samemu te skrypty, ale tak naprawdę czy nie lepiej jest wziąć skrypt z tej strony i zmodyfikowac go dla swoich potrzeb? Wprawdzie możemy taki skrypt napisać sami, ale po co, skoro stracimy czas na coś, co ktoś juz napisał, przetestował i może zagwarantować, że działa poprawnie. Któryś raz z rzędu opłacam abonament i nie raz jeszcze opłacę. Kawał dobrej roboty i ogrom wiedzy w jednym miejscu.
Piotr Karamański Design Studio
|
|
PODRĘCZNIK PHP 5.x, 4.x, 3.x - częściowo spolszczony / źródło: www.php.net
[Spis]
[A]
[B]
[C]
[D]
[E]
[F]
[G]
[H]
[I]
[J]
[K]
[L]
[M]
[N]
[O]
[P]
[Q]
[R]
[S]
[T]
[U]
[V]
[X]
[W]
[Z]
imap_mail (PHP 3 >= 3.0.14, PHP 4, PHP 5) imap_mail --
Send an email message
Descriptionbool imap_mail ( string to, string subject, string message [, string additional_headers [, string cc [, string bcc [, string rpath]]]] )
This function allows sending of emails with correct handling of
Cc and Bcc receivers. Zwraca TRUE w przypadku sukcesu, FALSE w
przypadku porażki..
The parameters to, cc
and bcc are all strings and are all parsed
as rfc822 address lists.
The receivers specified in bcc will get the
mail, but are excluded from the headers.
Use the rpath parameter to specify return path.
This is useful when using PHP as a mail client for multiple users.
User Contributed Notesuphonesimon at gmail dot com
23-Dec-2005 08:45
make sure you've correctly setup the SMTP parameters in php.ini
and aslo make sure that the SMTP server accepts relay
for some mail servers, you have to open up an imap stream, log in, and then you can send mail through imap_mail
nick at divbyzero dot com
13-Jul-2005 05:24
FYI, to finish your message post over telnet, enter a period (".") by itself as the last line of the post. Took me a while to google this so I thought I'd share. Then you can disconnect with 'quit'.
npeelman at cfl dot rr dot com
27-Mar-2005 03:53
It appears that there is no difference
between imap_mail() and mail()
as neither require an open imap stream
to function as long as your php-ini
is set up correctly. As you will notice
there is no IMAP stream identifier
in the arguement list for
imap_mail($to, $subject, $msg).
I'm guessing this is a way to bypass using mail(),
or sendmail() and not worrying which OS
you are on.
ex:
// no need to open stream
$mb = imap_open("{pop-server.???:110/pop3}INBOX",
"<username>","<password>");
imap_mail($to, $subject, $msg);
// no need to close stream
imap_close($mb);
bandpay at hotmail dot com
05-Jan-2001 03:01
Extending the above note.
When the socket connection is stablished, it works exactly as if you had openned a telnet connection to the news server. If you don't know what kind of headers you have to send to the news server, then I'll suggest that you better give it a try and play with a telnet connection like this:
telenet news.servername.com 119
eaxmple:
telnet news.euroconnect.dk 119
Trying 195.184.44.30...
Connected to news.euroconnect.net (195.184.44.30).
Escape character is '^]'.
200 news.euroconnect.net (Typhoon v1.2.1)
then you'll receive confirmation from the server that you are connected. Now type "help" and enter, and you'll see what commands are supported.
eaxmle:
help
100 Legal Commands
article [<messageid>|number]
authinfo type value
body [<messageid>|number]
date
group newsgroup
head [<messageid>|number]
help
last
list [active wildmat|active.times|counts wildmat]
list [overview.fmt|newsgroups wildmat]
listgroup newsgroup
mode reader
newgroups yyyymmdd hhmmss [GMT]
newnews newsgroups yyyymmdd hhmmss [GMT]
next
post
stat [<messageid>|number]
xhdr field [range]
xover [range]
xpat field range pattern
quit
If you want to post a message, you can start by entring the "post" command.
example:
post
340 Send Article to be Posted
From here you can start to enter the header information.
The most important headers are:
From:
Subject:
Newsgroup:
after the ":" a "white space" must follow.
If you are posting the multipart message then remember
MIME-Version: 1.0
This one is also one of the important headers when you are posting a multipart message. The boundary must follow the content type in the same line.
Content-Type: multipart/mixed; boundary="------------4A11A9ABCFCA70DD4E0C3605"
Take a look at the article below to find out more about headers and packing of the message.
http://www.phpbuilder.com/columns/kartic20000807.php3
bandpay at hotmail dot com
28-Dec-2000 03:01
If you need to send messages to a NNTP server, and you don't find the function, which is sufficient for this job, then use this.
$stream = fsockopen($server,$port, &$errno, &$errstr);
fwrite($stream, "POST\r\n");
fwrite($stream, "Newsgoups "$newsgroup."\n");
$fwrite ($stream, " What ever you need to write\n");
.........
fwrite($stream, "The rest of what you like to write\n");
fclose($stream);
There are ofcourse not so straight, but if you know which parameters your message needs, you can do it like this.
You can build up a message with imap_mail_compose ();
When you a complete message then U can write it to the server, and the server will take care of the time, date, Massage-ID and so on, but you have to know the sturcture of the header which you make, and if you like to write a multipart message, then you better get to know it in details.
In case that you know a better way, please inform me.
Good luck.
mgsander at schaap dot dhs dot org
03-Dec-2000 07:09
You can change the From field in your message by specifying "From: blabla@yadayada.net" in the additional_headers field.
|