Imagine if you are sending an email by the gmail.com using web online interface so entering the website of google, then compose mail and send it. In this case your ip address is not revealed to the receiver of mail. In details of mail header there are google server's informations.

If it is good or not it is a topic for a big discussion, have some advantages and disadvantages... However only one way to get someone's ip address so location is court way and lawyer sending a document to google with a question to reveal ip address of sender of the particular mail. Am I right ?

What is my wondering right now is if I have same privacy (assuming I claim true above) in case of using a program and perform a function like this:

    public static void SendAnEmail(MailAccount mailAccount, Mail mail)
        SmtpClient client = new SmtpClient();
        client.Port = 587;
        client.Host = mailAccount.host;
        client.EnableSsl = true;
        client.Timeout = 10000;
        client.DeliveryMethod = SmtpDeliveryMethod.Network;
        client.UseDefaultCredentials = false;
        client.Credentials = new System.Net.NetworkCredential(mailAccount.username, mailAccount.password);

        MailMessage mailMessage = new MailMessage(mailAccount.username, mail.mailTo, mail.subject, mail.body);
        mailMessage.BodyEncoding = UTF8Encoding.UTF8;
        mailMessage.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;


where Mail contain subject, body and mailTo strings and MailAccount have username, password and host, so all required informations to send an email. The whole code is written in C# by the way.

Imagine that I have a program which is doing some office work and at the end of some activities is going to send an email using code above of course using a google host (an account created at google website). Then - what is happening ? What is in mail details header ? My computer ip address or google server ones ? Do this mail contain some more information like mac address of network card or my motherboard.

I hope you understand my question, if it is not clear, please ask questions about my situation. Any suggestion how to obtain such a privacy using "mailing by code" would be appreciated. However explanation of the situation it is what I am looking for.

Thank you in advance and have a nice day.

closed as off-topic by Neil Smithline, Xander, Steffen Ullrich, WhiteWinterWolf, Steve DL Jan 13 '16 at 11:01

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about Information security within the scope defined in the help center." – Neil Smithline, Xander, Steffen Ullrich, WhiteWinterWolf, Steve DL
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Welcome to Stack Exchange for Security! Here's a link for a tour of the site and how it works. security.stackexchange.com/tour Thanks for your contribution and again, welcom. Cheers! – Citizen Jan 12 '16 at 19:17
  • 1
    This is not really a security question. Also, all of your questions can be answered by testing your code and reading the header. – schroeder Jan 12 '16 at 19:18
  • 2
    Definitely test your code. Remember that Google is free to change their behavior on details like this without notification. I suspect that they will only make changes to be more private, but you never know. – Neil Smithline Jan 12 '16 at 21:21

Browse other questions tagged or ask your own question.