I have a register form that send an email to the user. here is the way i do it (with a smtp server)
$fromserver = "noreply@XXX.com"; require("