Hello Everyone,
I've made the email and attachment section of the program, pulling an email from an excel file.
However i'm trying to work out how to create the mailmerge part. I've allowed the user of the program to select the headings of the columns of the excel document.
Say the document has Email, First Name and Last Name. It could have more of less columns but we'll use these for arguement. They can add these as tokens "<%First Name%> in the rich text box. So i want to find these tokens and replace them with the text from that row that equals the email address used.
The code below I can't get to work, and does not include the email sending function. The email address would be selected from the combo box loaded with the form.
private
{
da.Fill(dt);
excelSheetNames[i] = row[c].ToString();
i++;
}
listBox1.Items.Add(excelSheetNames[s].ToString());
c++;
excelSheetNames[j] = row[c].ToString();
sb.Replace(textReplace, textReplaced);
richTextBox1.Text = sb.ToString();
con.Close();
excelSheetNames[i] = column.ToString();
comboBox1.Items.Add(excelSheetNames[s].ToString());