I have a program which has 4 layers, the PL, Webservice, BL and DL. I have a form which sents an email, any suggestions where should I write the code for sending emails.
Thanks
Have a dedicated application which sends emails from either a Database or XMl file and update "sentMails" status for that particular mail. Let your form gather all information required for sending mails, like message, sender & receiver mail, sttachments etc . Do the required validation using regular expression and required field validators. Then on "submit" store the information in Database or XML file with "sentMail" status as False. Your mail sending program then periodically "scans" for mails to be sent and send them. If mails are successfully sent then updates the status. SmtpClient class
Comment