Does anyone know the C# code to attach the current InfoPath document to the email using this (or the newer System.Net.Mail.MailMsg option)
Basically got code like this
System.Net.Mail.MailMessage MailMsg = new System.Net.Mail.MailMessage();
MailAddress sentfrom = new MailAddress(System.Environment.UserName + "@companyname." + domainvalue);
MailMsg.To.Add(domNav.SelectSingleNode("/my:TimesheetDetails/my:Department", NamespaceManager).Value + "manager@companyname." + domainvalue);
MailMsg.From = sentfrom;
MailMsg.Subject = "Timesheet approval form from " + domNav.SelectSingleNode("/my:TimesheetDetails/my:EmployeeInformation/my:EmployeeName", NamespaceManager).Value;
SmtpClient sendmail = new SmtpClient();sendmail.Host = "hostname";
sendmail.Send(MailMsg);
Basically I've created a "Submit for approval" button on my form which I then want to email to the department manager, using InfoPath 2007 client (using the DataConnections["Email Submit"].Execute command) this works fine, but using Browser based forms I get a error and the mail server is set up correctly on our MOSS server.
My other option is using workflows on the timesheet but I figured this way should be achievable - just can't find the right command to attach the view that InfoPath manages to create.
Thanks