How to set email validator to actually send verification email

i would like to understand how to make program sent validation email , and how to create validation link to this email