imap_mail

(PHP 4, PHP 5, PHP 7, PHP 8)

imap_mailBir eposta iletisi gönderir

Açıklama

imap_mail(
    string $kime,
    string $konu,
    string $ileti,
    ?string $ek_başlıklar = null,
    ?string $cc = null,
    ?string $bcc = null,
    ?string $dönüş_yolu = null
): bool

Cc ve Bcc alıcıları doğru yorumlanan epostaların gönderimine imkan verir.

kime, cc ve bcc bağımsız değişkenleri birer dizge olup » RFC 822'ye göre yorumlanırlar.

Bağımsız Değişkenler

kime

Alıcının adresi.

konu

Postanın konusu.

ileti

Postanın gövdesi. Bkz: imap_mail_compose()

ek_başlıklar

Posta üzerinde gönderilecek ek başlıkları içeren bir dizge.

cc

bcc

Kara karbon kopya alıcıları (bcc) olarak belirtilen alıcılar eposta başlıklarında görünmez.

dönüş_yolu

Posta teslim edilemezse kullanılacak dönüş adresi bu bağımsız değişkende belirtilir. PHP'nin çok sayıda kullanıcı için posta istemcisi olarak çalıştığı durumda yararlıdır.

Dönen Değerler

Başarı durumunda true, başarısızlık durumunda false döner.

Sürüm Bilgisi

Sürüm: Açıklama
8.0.0 ek_başlıklar, cc, bcc ve dönüş_yolu artık null olabiliyor.

Ayrıca Bakınız

add a note add a note

User Contributed Notes 4 notes

up
3
Patanjali
6 years ago
In response to Mathias Rav's comment.

While imap_mail might have this $rpath bug, it is hardly comparable to mail, because mail only uses the default send mail server account, and not a real mailbox, which you can programmatically interrogate and clean up.

Using the imap extension allows proper mail management and operation, like users not getting the cryptic server account name followed by 'on behalf of' the 'From' address that mail sourced emails show on some recipient clients.
up
-4
Mathias Rav
15 years ago
As per http://bugs.php.net/bug.php?id=30688 the $rpath argument is ignored, and since the (as of now) 4 year old bug is tagged WONTFIX in the bug tracker, this function is effectively deprecated in favour of mail().
up
-9
bandpay at hotmail dot com
23 years ago
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
up
-17
uphonesimon at gmail dot com
18 years ago
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
To Top