If you are doing simple newsletter subscription, you don't have to write any custom code. Please check whether you have email configured and not blocked by any firewall .Please read the newsletter documentationhttp://docs.adobe.com/docs/en/cq/5-6/wcm/campaigns/newsletters.html#Creating%20a%20newslet...