Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I'm using MvcMailer to send out email from my MVC application. I don't want to specify the recipient ('TO') address but instead I would like to have the sender to manually enter it in. Is this possible?

Thanks for all the help.
Posted
Comments
Sergey Alexandrovich Kryukov 1-Sep-15 15:31pm    
Strange question. Who would ever use any mail library/framework if hard-coding of the address was required? :-)
—SA
Nadine Hua 1-Sep-15 17:13pm    
Thanks for your reply. Seems like my question was not cleared.
I don't want to provide the recipient address
ie x.To.Add("John.Doe@gmail.com");
but have this blank and allow user to enter it in when the new email message popup.
Sergey Alexandrovich Kryukov 1-Sep-15 17:40pm    
And how can it be a problem?
—SA
Nadine Hua 1-Sep-15 20:02pm    
MvcMailMessage Welcome() method would throw an exception

1 solution

Please see, for example, this manual: https://github.com/smsohan/MvcMailer/wiki/MvcMailer-Step-by-Step-Guide[^].

I think it should be obvious that any place where any mail header is a hard-coded string can be replaced with the function taking the data from some control, or HTTP request coming from a form page, or any other source of data.

—SA
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900