Email Attachments
Mon 27 Jan 2020 - 11:12
What script do we need to add more than one attachment to an outgoing email? For example, we would want to add two word documents and one pdf? eg.
- Code:
FWBS.OMS.OMSFile _file = Enquiry.Object as FWBS.OMS.OMSFile;
string _subject = "Completion Monies Received - " + Convert.ToString(_file.Client.ClientNo) + "/" +
Convert.ToString(_file.FileNo) + "-" + Convert.ToString(_file.PrincipleFeeEarner.FullName);
//Subject for the email string
_body = "Completion Monies have been received for " + Convert.ToString(_file.FileDescription) + Environment.NewLine +
Environment.NewLine + "Client Name: " + Convert.ToString(_file.Client.ClientName) + Environment.NewLine +
"Completion Amount: £" + EnquiryForm.GetIBasicEnquiryControl2(“amrecsol”,EnquiryControlMissing.Exception).Value +
Environment.NewLine + "Completion Monies Received From: " +
EnquiryForm.GetIBasicEnquiryControl2("payrecsol",EnquiryControlMissing.Exception).Value;
//Body for the email string
_from = "alert@fridaysmove.com";
//The from address string
_to = Convert.ToString(_file.PrincipleFeeEarner.Email) + ", davidsa@fridaysmove.com";
//The to address
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(_from, _to, _subject, _body);
string server = "xxx";
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient(server);
client.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
client.Send(message);
Permissions in this forum:
You cannot reply to topics in this forum
|
|