Add SMTP to my custom form

I'm having some major confusion on how to add SMTP to my custom form! Can you help with this?