Digital Marketing, Gaming, and Hacking
Brought to you by:
Matrix Tools
(1 / 57 Articles)
View Categories

Email Response Bot

Sub Category
Last Updated
If you would like to setup a custom email alias for you or your company, please check out this link first: Custom Email Aliases

This article will go over how to setup SMTP for an automatic email generator.
If I am doing this for a client company, I will first setup their Custom Email Alias (with the link above).
I will setup a wildcard for their domain pointing all emails to their inbox...
However, I will also create a "contact" alias pointing to my own inbox, that way I can setup the Email Alias myself and attach it to my own account.
I will verify this new "contact" email on my Gmail account and set it as NOT an alias.
I will also hardcode all "to" values to my email address.
I will then test their SMTP, test my code to generate an email from their domain, and test their contact form, before finally deleting the "contact" alias which will switch everything back over to the client's inbox, and finally changing any "to" values in the code from my email address to their inbox.

That is really the main point of the article, however, I will also include some sample C# code on how I do this:
using (var SmtpServer = new SmtpClient("")) { var mail = new MailMessage { From = from, Subject = subject, IsBodyHtml = true, Body = htmlBody, }; mail.To.Add(to); // Adjust the Reply To mail.ReplyToList.Clear(); mail.ReplyToList.Add(replyTo); SmtpServer.Port = 587; SmtpServer.UseDefaultCredentials = false; SmtpServer.DeliveryMethod = SmtpDeliveryMethod.Network; SmtpServer.Credentials = new NetworkCredential("", Password); SmtpServer.EnableSsl = true; SmtpServer.Send(mail); EmailRetryAttempts = 0; return true; }

Permanent Link
If this article helped you, or you have any thoughts on how to do this better, please click the Like button and/or leave a comment below.

Likes: [0]

Comments: [0]

(if you'd like us to reply and/or show your gravatar image)