Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# SMTP
Hi ,
 
Hope u are doing well !!!
 
In one of my projects I am using SMTP client for sending mail.
My SMTP Host is : smtp.bizmail.yahoo.com.
 
I am using sender mail id as original@ABC.com and which exists.
 
I want when the user receive this mail the sender mail id should be shown as welcomemail@ABC.com and this one is dummy mail id.
 
I have tried for displayName property, it shows display name but still original sender mail id is intact.
 
Can you please guide me for this ?.
 

Thanks,
Hemant Thakar.
Posted 14-Feb-13 20:17pm
Edited 14-Feb-13 20:18pm
v2
Comments
aspnet_regiis -i at 15-Feb-13 3:22am
   
You will have to use SMTP server from abc.com
 
If it would have been possible what you are asking for, then everybody would be using GMail server for sending emails instead of setting up their own..

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

When you create the MailAddress instance for the From property of the MailMessage class instance, there is an override constructor that does that: http://msdn.microsoft.com/en-us/library/1s17zfkf.aspx[^]
There is a generic routine that includes it here: Sending an Email in C# with or without attachments: generic routine.[^]
  Permalink  
Comments
Hemant Thaker at 15-Feb-13 4:18am
   
Thanks,
 
Using DisplayName will show display name but it will not eliminate sender email id. Sender Id is still visible in mail.
OriginalGriff at 15-Feb-13 4:41am
   
Correct - you can't completely spoof your email address to prevent spam emails pretending to be from a genuine company.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 667
1 ashok rathod 174
2 CPallini 140
3 ChauhanAjay 135
4 CHill60 130
0 Sergey Alexandrovich Kryukov 9,735
1 OriginalGriff 6,989
2 CPallini 5,825
3 George Jonsson 4,017
4 Gihan Liyanage 3,266


Advertise | Privacy | Mobile
Web01 | 2.8.140926.1 | Last Updated 15 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100