How can I hide the 'to' field in the email sent by php mail - email-headers

I am using php mail function to allow user to send me a mail from
website.
I am also allowing them to "cc" the email to themselves.
The whole purpose of making a "send us message" feature was not give our email to the users. But when the user selects the "cc" option, in the header of the mail that is sent to the user, the "to" field contains our primary email address.
How can I remove this, so that the users do not see our primary email address in the to field.

You could set the mailTo to an arbitrary mailbox at your domain "noreply#yourdomain.com" and add your company address in BCC?
But whatever reason you have for not exposing your email, imho it's quite unpolite :)

The e-mail message sent to you must have a To: field to be delivered correctly. You could emulate the CC feature by sending to separate e-mail messages to the office and to the client.

Related

Reply to email other than from/reply-to field

My system sends emails on behalf of my users (each user has customers).
When a customer replies to that email, it should reply to my app email instead so I can utilise the inbound parse functionality.
However, I want to display the user's email in the from/reply-to field. Is this possible?
from and reply-to are not the same thing. Send from the user's address in the from field, then use your app's email in the reply-to.

Can Thunderbird choose the correct account?

I have a question about sending a mail with mozilla thunderbird. I have several email-addresses and i want thunderbird to choose a certain account when i send an email to a certain recipient.
For example I have two accounts: mail#myaddress.com and mail#anotheraddress.com
If I send an email thunderbird uses per default mail#myaddress.com. So far so good. Sometimes I have to send an email to companies, where I have to use mail#anotheraddress.com as sender address. If I forget to switch the account theses companies get mails from the wrong mail address. Is there a way to connect a recipient emailaddress to an certain account?
You can compose email using command line:
"preselectid" : an identifier for the "From" identity to choose from the menu*
note that you cannot directly specify an e-mail address but need to find the identity key
for example, "preselectid=id2" would select the identity #2
Reference:http://kb.mozillazine.org/Command_line_arguments_%28Thunderbird%29

Is there a way to prevent mail clients from caching an email address?

We have an application that allows users exchange messages, and delivers the message through email. But we don't reveal sender's email, instead; every time a message is sent out a new email address gets generated for the "From" field. Something similar to the way Facebook or LinkedIn send out messages.
Everything works fine, except the recipient's email client caches all these email addresses.
For instance, if Jack sends two messages to Jill, the sender's addresses can be: a123#FakeEmail.com and a456#FakeEmail.com, so next time Jill composes a new message and starts typing Jack's name, the email client suggests two addresses for Jack.
So my question is, how we can prevent email caching on client's machine? Is there something similar to HTTP header Pragma: no-cache for SMTP?
Thanks
Nivresh
OK, here is what I ended up doing. To prevent Outlook and other mail clients from suggesting several dummy email addresses generated for the same contact name, I add a special character to the beginning of the sender's name. This can be a space or if you use Unicode, you can add a zero-width space (\u200B) to the beginning of the name.
So in my example, the email is sent from "\u200BJack" which will be shown as "Jack". The dummy email address will be saved in mail client under the name of "\u200BJack" and when the recipient later on tries to send an email to Jack, email client won't suggest this address.
Hope this helps someone.

PHPMailer or php mail function - show BCC address

I'm using PHPMailer to send mails to a clients database when certain events triggers. Obviously I don't want everyone to get the full list of client's emails, so i'm sending those in BCC using PHPMailer. It's working fine, but there is one problem.
The customer that receive the email got nothing in the field of the targeted email. Just blank. Shouldn't he be able to see his own address and own name I'm sending ? It's helpfull for people who are redirecting emails to know which was targeted.
Same goes with PHP native mail() function.
Is there a way to handle this ?
Thanks ahead !
No, that's not how BCC works.
If you receive an email via BCC, your mail client will show you the original recipient's address in the 'to' field, not yours.
This applies to all BCC mails; it has nothing to do with phpMailer.
If you want the recipients to see something in the 'to' field, you need to populate it with a dummy value -- for example, 'donotreply#yourdomain.com'.
It is good to send messages like this via BCC, so you're doing the right thing. But if you really want the end user to see his own email address in the 'to' field, then the only way to do it is to send the message to each user as a separate email, so you use the 'to' field and not 'bcc'. However, this will dramatically increase the load on your mail systems, so it's probably not the answer.
That's the nature of email. When a person is BCC'd, they will only see the To:, From: and CC: fields. The BCC field will hide every single email address, even the recipient's.
From wiki:
There are three ways in which the "BCC:" field is used.
In the first case, when a message containing a "BCC:" field is prepared to be sent, the "BCC:" line is removed even though all of the recipients (including those specified in the "BCC:" field) are sent a copy of the message.
In the second case, recipients specified in the "To:" and "CC:" lines each are sent a copy of the message with the "BCC:" line removed as above, but the recipients on the "BCC:" line get a separate copy of the message containing a "BCC:" line. (When there are multiple recipient addresses in the "BCC:" field, some implementations actually send a separate copy of the message to each recipient with a "BCC:" containing only the address of that particular recipient.)
Finally, since a "BCC:" field may contain no addresses, a "BCC:" field can be sent without any addresses indicating to the recipients that blind copies were sent to someone.

How to set from mail address other than smtp authentication mail in java mail

I am specifying "FROM" address usinf setFrom() method, But i still receive mails having "FROM" address of SMTP authentication mail id. and want to set the "FROM" address dynamically. which keeps changing. What is the RFC282 standard to achieve this.
The solution from google is this
Gmail lets you send messages with another of your email addresses listed as the sender instead of your Gmail address. This feature helps you manage multiple accounts from the Gmail interface; it works only if you already own the email account linked to the alternate address
Select the Accounts and Import tab (or Accounts tab, if you're using Google Apps).
Under Send mail as, click Add another email address.
In the 'Email address' field, enter your name and alternate email address.
Choose one of two options:
Use Gmail's servers to send your mail (this is easier to set up)
Use your other email provider's SMTP servers (we recommend this option for professional mail accounts or domains). Note for Google Apps users: Depending on your domain2 type, this feature may be disabled by default. Talk to your administrator if you have any questions.
If you choose to use Gmail's servers:
Click Next Step >> and then click Send Verification. Gmail will send a verification message to your other email address to confirm that you own it.
Open your other account and either click the link in the message Gmail sent or enter the confirmation code in the Accounts section of your Gmail settings.
For more info, follow the below link
https://support.google.com/mail/bin/answer.py?hl=en&answer=22370.
The overhead involved is that any new from address needs a alias to be set in Gamil authentication mail account. Its not suits for enterprise salable app.
Other solution is You can install a mail server (hmailServer). This server allows you to set the custom from address
If any body knows other solutions, please suggest me.
It's up to your mail server. Often mail servers will prevent you from using any From address other than your actual login name. This helps prevent spam. Depending on your mail server, there may be ways to convince it that you should be allowed to use other From addresses.
These are two different things that you are talking about:
The id that you are mentioning is part of smtp handshaking protocol which usually is mapped to "Return-path" field in mime-header.
Whereas the id that comes in "FROM" field which actually is displayed in mail-list is been appended by the mail server when u compose the mail.
So if you can modify the mime header then make sure that "FROM:" field contains the id that yuou want to set not the smtp authentication id.
btw its rfc822
Have worked for rediffmail technical team in order to develop and enhance smtp, pop and imap protocols
Its depends on your mail server and configuration setting