update logic for supporting smtp server