DMG Posted January 24, 2008 Report Share Posted January 24, 2008 Palīdziet man lūdz šādā lietā! Ik reiz kad sūtu e-mailu man pie sūtītāja parādās "Kam: un mans e-mails". Kā var dabūt nost to "Kam: " Šobrīd lietoju: $headers = "From: $email" . "\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=UTF-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; Ir kādas idejas? Link to comment Share on other sites More sharing options...
Aleksejs Posted January 24, 2008 Report Share Posted January 24, 2008 Un kāds izskatās pats mail() izsaukums? Link to comment Share on other sites More sharing options...
DMG Posted January 24, 2008 Author Report Share Posted January 24, 2008 (edited) $headers = "From: $email" . "\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=UTF-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; @mail($mans,$vards,$zina,$headers); Ceru ka skaidrot mainīgs nevajag jo izņemot hederi tur tāpat ir vienārši teksts attiecīgais vai mans emails :) Heh laikam sapratu savu kļūdu šai jautājumā! Bet nekas paturpināšu domu un pajautāšu kā var uzlikt, lai kad nosūtu e-mailu tai lodziņā "From" Parādītos tikai piemēram DMG? Ja izlaboju $headers = "From: DMG" . "\r\n" Man parādās DMG@mana servera adrese Gribētos lai parādās tikai tas DMG. Edited January 24, 2008 by DMG Link to comment Share on other sites More sharing options...
mounkuls Posted January 24, 2008 Report Share Posted January 24, 2008 serveris Tavs? Ja nē, šaubos ka vari mailot kā ienāk prātā Link to comment Share on other sites More sharing options...
DMG Posted January 25, 2008 Author Report Share Posted January 25, 2008 Nē nav man. Tātad tas jau ir servera vaina nevis skripta ka nevaru tā nosūtīt? Link to comment Share on other sites More sharing options...
mounkuls Posted January 25, 2008 Report Share Posted January 25, 2008 Velns viņu zin. A kas slikts tam ja From ir tavs hosta mails? Link to comment Share on other sites More sharing options...
Vebers Posted January 25, 2008 Report Share Posted January 25, 2008 FROM: DMG <feiks@epasts.lv> labākais variants... Link to comment Share on other sites More sharing options...
Aleksejs Posted January 25, 2008 Report Share Posted January 25, 2008 Nebūs vis tā, Veber! ;) Problēma ir tāda, ka PHP automātiski padod to adresi kas definēta (laikam php.ini failā). From: bla bla ir tikai header - tas netiek izmantots SMTP protokola sākumdaļā: telnet mail.islandnet.com 25 220 Islandnet.com ESMTP server ready helo a.b.c 250 mail.islandnet.com Hello x [YOUR_IP_ADDRESS] mail from:<YOUR_ADDRESS> 250 <YOUR_ADDRESS> is syntactically correct rcpt to:<YOUR_ADDRESS> 250 <YOUR_ADDRESS> verified data 354 Enter message, ending with "." on a line by itself From: Bugs Bunny To: Daffy Duck Subject: Loony Toons! Hi there! . 250 OK id=1778te-0009TT-00 quit 221 mail.islandnet.com closing connection Piemēru nekaunīgi paņēmu no šejienes Kā redzi, tad From headerī var ierakstīt vienu lietu (Bugs Bunny), bet MAIL FROM: protokola sākumposmā - citu adresi. Risinājums: izlasam par mail() funkciju šo te daļu: additional_parameters (optional) The additional_parameters parameter can be used to pass an additional parameter to the program configured to use when sending mail using the sendmail_path configuration setting. For example, this can be used to set the envelope sender address when using sendmail with the -f sendmail option. The user that the webserver runs as should be added as a trusted user to the sendmail configuration to prevent a 'X-Warning' header from being added to the message when the envelope sender (-f) is set using this method. For sendmail users, this file is /etc/mail/trusted-users. Tātad - mail('adresats@adrese.lv', $subject, $message, $headers,'-fsutitajs@sutitajaadrese.lv'); N.B. starp parametru -f un adresi nav atstarpe! Link to comment Share on other sites More sharing options...
Recommended Posts