Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Admin
Admin
Posts : 122
Join date : 2018-12-17
https://mattersphere-devs.forumotion.com

Email Attachments Empty 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);
Back to top
Permissions in this forum:
You cannot reply to topics in this forum