email-headers

change full header for sending mail in php

别说谁变了你拦得住时间么 提交于 2019-12-13 04:28:00
问题 I use this code to send mail in php : mail($to,$subject,$message,$headers); It works perfectly but if we check the mail's full header it's gonna show the server of the site which the mail has been sent with that. I want to know is there any possible way so that we can change the full header of that and show something else in the full header in the mail. Thanks in advance 回答1: All mail servers will add an Received header row to the message. You can configure your own server(s) to not add such

header function mail() php

人盡茶涼 提交于 2019-12-13 02:28:17
问题 i have to send mail with function mail() of PHP. I have to insert Reply-To header but it not work: <?php $body = "<html>\n"; $body .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:12px; color:#666666;\">\n"; $body = $message; $body .= "</body>\n"; $body .= "</html>\n"; $headers = "From: My site<noreply@example.com>\r\n"; $headers .= "Reply-To: info@example.com\r\n"; $headers .= "Return-Path: info@example.com\r\n"; $headers .= "X-Mailer: Drupal\n"; $headers .=

From address is not working for PHP mail headers

我的未来我决定 提交于 2019-12-12 01:11:45
问题 I'm sending "no-reply" mails using PHP mail function. The problem is that mails were sent, but not receiving in my inbox when I use the following "From" headers: From: Sender Name <noreply@localhost.com> From: noreply@localhost.com From: Sender Name <test@localhost.com> I have no actual mail address noreply@localhost.com , but I have test@localhost.com . I think all of them are the correct formats according to the PHP documentation. When I tried From: test@localhost.com , it did work and I

Decoding UTF-8 Encoded Header

巧了我就是萌 提交于 2019-12-11 08:48:22
问题 I'm using PHP imap to read emails out of an inbox. It extracts some information from headers. One of the headers looks like this: X-My-Custom-Header: =?UTF-8?B?RXVnZW4gQmFiacSH?= The original value of that encoded string is Eugen Babić. When I try to decode that string using PHP, I can't get it quite right, the ć always comes back messed up. I've tried imap_utf8, imap_mime_header_decode and a bunch of others I can't quite recall. They either don't return anything at all, or they mess up the ć

PHP Send Mail with HTML not working

回眸只為那壹抹淺笑 提交于 2019-12-11 04:33:55
问题 I'm sending a php html mail with this code: $msg = "<p>Beste,</p> <p>Sorry, maar momenteel zijn deze CD uitverkocht. Daarom is uw order met ordernummer 15 opgesplits. Uw eerste order ( 15 ) wordt volgens planning geleverd.</p> <p>Het order nummer voor uw overige producten die niet geleverd kunnen worden is: 16. Deze hopen we zo spoedig mogelijk te leveren.</p> <p> </p> <p>Sorry voor het ongemak.</p> <p>Met Vriendelijke Groet,<br /> Wij</p> "; $message = '<html dir="ltr" lang="en">' . PHP_EOL;

Replacing deprecated eregi() with stristr(). Is this php mail script secure from header injections?

岁酱吖の 提交于 2019-12-11 01:36:44
问题 I've been using the same php script to send emails from contact forms for years. But when my web server upgraded to php 5.3 the call to eregi was causing deprecated errors to display. After a Google search I learned that I could use stristr instead of eregi. When I make this simple switch everything works just fine, but I'm no php wizard so I want to know if my script is still secure from header injections. Can someone please put my mind at ease and confirm that this script is safe (or at

C# Email subject parsing

梦想的初衷 提交于 2019-12-10 09:21:31
问题 I'm building a system for reading emails in C#. I've got a problem parsing the subject, a problem which I think is related to encoding. The subject I'm reading is as follows: =?ISO-8859-1?Q?=E6=F8sd=E5f=F8sdf_sdfsdf?= , the original subject sent is æøsdåføsdf sdfsdf (Norwegian characters in there). Any ideas how I can change encoding or parse this correctly? So far I've tried to use the C# encoding conversion techniques to encode the subject to utf8, but without any luck. Here is one of the

How can the Return-Path header be different than the actual email bounce recipient?

时光怂恿深爱的人放手 提交于 2019-12-10 02:09:41
问题 I recently moved my transactional email sending to Mailgun It works good so far however I am wondering about the return-path header. Consider this email (I removed irrelevant header and replaced email/domain for privacy purposes) Delivered-To: RECIEVER@gmail.com Received: by 10.76.154.104 with SMTP id vn8csp478308oab; Wed, 4 Sep 2013 05:04:44 -0700 (PDT) X-Received: by 10.50.22.105 with SMTP id c9mr1537992igf.36.1378296283817; Wed, 04 Sep 2013 05:04:43 -0700 (PDT) Return-Path: <bounce+a801a1

How to stop HTTP (and rfc822, email) header injection?

时光总嘲笑我的痴心妄想 提交于 2019-12-10 00:03:22
问题 (I am asking this question (and answering it), to make accessible some (hopefully useful) information, since I could not find this readily using search engines. However, feel free to answer it and add useful information :-).) How can HTTP headers be escaped/quoted in Python? And/Or how can they be validated to make sure they do not contain any context-escaping values? In other words, how can we do for HTTP headers, what cgi.escape and urllib.quote methods (and sanitizing) do for HTML and URLs

RegEx to match time in “Received: by” e-mail header

泪湿孤枕 提交于 2019-12-08 05:06:13
问题 On the shared-host where my website is, I have an e-mail forwarder that sends messages to my phone as a text message. Recently, however, it's been getting a bit out of hand. I am hoping that, using the "User Level Filtering" in cPanel, I can setup a RegEx-based filter to only forward e-mails to my phone between the hours of 07:00:00 and 22:00:00. This filter would match the following e-mail header, which typically occurs 2-3 lines into the message source: Received: by 99.99.99.99 with SMTP id