send an email from office 365 as from address not same as Credential Address
Jun 19, 2020 07:16 PM|anjaliagarwal5@yahoo.com|LINK
I want to send an email in ASP.net where I want to hide the email address that I send to the customers. I want to show them a different email address in the From box so for e.g. I want to send an email from abc@abc.com, this email is authenticated.
When the end user receives the email in their inbox, they will see a different address called test@test.com. They can reply to this email. I have this code so far:
testMessage msg = new MailMessage();
msg.To.Add(new MailAddress(txtemail.Text.Tostring(), "To Name"));
msg.From = new MailAddress("abc@abc.com", "From Name");
msg.Subject = "This is a test";
msg.Body = "Hello, this is a test email";
msg.IsBodyHtml = true;
SmtpClient client = new SmtpClient();
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential("userName", "PASS");
client.Port = 121;
client.Host = "smtp.office365.com";
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.EnableSsl = true;
I don't want the customers to see my abc@abc.com email address. Instead of that, I want them to see Test@test.com. How can I achieve this? They can reply to test@test.com. I don't want them to reply to abc@abc.com. I am not sure which settings should I change
to do this?
Create a test@test.com account and use that account to send and receive emails. Create a forward rule if you want the email forwarded to your abc@abc.com account.
do you have any example for that? I also want to hide the
abc@abc.com. I dont want users to see abc@abc.com
No. As far as I know the from email address must match the login account. Create a new account with any email address you like and use that address. You can always forward emails to your account.
Accroding to your description, I suggest you could create a general email account and send all message using this. If you then would like to forward each message to the correct sender, you need to interact with your incoming mails on the server and do
something to forward them to appropiate user.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
511 Points
1273 Posts
send an email from office 365 as from address not same as Credential Address
Jun 19, 2020 07:16 PM|anjaliagarwal5@yahoo.com|LINK
I want to send an email in ASP.net where I want to hide the email address that I send to the customers. I want to show them a different email address in the From box so for e.g. I want to send an email from abc@abc.com, this email is authenticated. When the end user receives the email in their inbox, they will see a different address called test@test.com. They can reply to this email. I have this code so far:
I don't want the customers to see my abc@abc.com email address. Instead of that, I want them to see Test@test.com. How can I achieve this? They can reply to test@test.com. I don't want them to reply to abc@abc.com. I am not sure which settings should I change to do this?
Any help will be highly appreciated.
All-Star
53051 Points
23644 Posts
Re: send an email from office 365 as from address not same as Credential Address
Jun 19, 2020 07:22 PM|mgebhard|LINK
Create a test@test.com account and use that account to send and receive emails. Create a forward rule if you want the email forwarded to your abc@abc.com account.
Member
511 Points
1273 Posts
Re: send an email from office 365 as from address not same as Credential Address
Jun 19, 2020 07:40 PM|anjaliagarwal5@yahoo.com|LINK
do you have any example for that? I also want to hide the abc@abc.com. I dont want users to see abc@abc.com
All-Star
53051 Points
23644 Posts
Re: send an email from office 365 as from address not same as Credential Address
Jun 19, 2020 08:55 PM|mgebhard|LINK
No. As far as I know the from email address must match the login account. Create a new account with any email address you like and use that address. You can always forward emails to your account.
Contributor
3730 Points
1427 Posts
Re: send an email from office 365 as from address not same as Credential Address
Jun 22, 2020 06:29 AM|yij sun|LINK
Hi anjaliagarwal5@yahoo.com,
Accroding to your description, I suggest you could create a general email account and send all message using this. If you then would like to forward each message to the correct sender, you need to interact with your incoming mails on the server and do something to forward them to appropiate user.
More details,you could refer to below article:
https://forums.asp.net/t/1502700.aspx?Hiding+the+Mail+Sender+Address
Best regards,
Yijing Sun