These properties are system-wide settings. They are not supposed to be changed by a user, but are persistent defaults. If you need to change the source address of an email generated by AEM you can use the methods described by the other responses. But you should never change OSGI configurations with input provided a user.
Why do you want to set this within Code? eMail configuration should be very static and known upfront. It's a property of the AEM instance (because it relates to the environment the application is running in) and should not be set by code.
What is your usecaes that you want to set these properties by code?