I am creating a website for user to fill out information. After completed fill out information, the user click button to submit a ticket and send email to me as a copy. However, I didn't receive any email after I click to send it. The submit ticket was successful except the email. We use Microsoft Outlook. Anyone know why or I am missing something?
I did add the reference using Outlook = Microsoft.Office.Interop.Outlook;
C# codes,
protected void BtnIPAM_Click(object sender, EventArgs e)
{
//codes for submitting ticket then send email
string uid = Bam.NEAt.GetUserID();
try
{
//Create the Outlook application
Outlook.Application oApp = new Outlook.Application();
//Create the new message
Outlook.MailItem oMsg = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
//Add a recipient
Outlook.Recipient oRecip = (Outlook.Recipient)oMsg.Recipients.Add("xxxxx@xxxx.com");
oRecip.Resolve();
//Set the basic properties
oMsg.Subject = "A Copy of IP Address Request";
oMsg.Body = "This is a test who sent by " + uid;
//Send the message
oMsg.Save();
oMsg.Send();
oRecip = null;
oMsg = null;
oApp = null;
}
catch {}
}