Click here to Skip to main content
15,892,839 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

I want to send mail in windows mobile application ,
my code is,
C#
private void btnsubmit_Click(object sender, EventArgs e)
        {
            try
            {
                OutlookSession ol = new OutlookSession();
                EmailMessage em = new EmailMessage();
                em.To.Add(new Recipient("iyal", "iyalarasi.r@winxsolutions.com"));
                em.Subject = "Request For Leave";
                em.BodyText = txteno.Text + "request" + cb1.SelectedItem.ToString() + "leave for" + txtreason.Text;
               // EmailAccount ea = ol.EmailAccounts[0];
                em.Send("iyalarasi");//outlook Account Name
                MessagingApplication.Synchronize("iyalarasi");
                MessageBox.Show("mail sent");
                Form2 f2 = new Form2();
                f2.Show();
                f2.lblmsg.Text = "You have Applied Leave";
            }
            catch (PocketOutlookException ex)
            {
                lblmsg1.Text = ex.ToString();
            }
            catch (Exception e1)
            {
                lblmsg1.Text = e1.ToString();
            }
          }

It show error Incorrect Account name,
I checked with google also.What is Account name in Outlook it is username or name visible in mail?

Please help me.

Need to finish this task soon.
Posted
Updated 18-Oct-12 19:04pm
v2

1 solution

It is the name display in your account.

Thanks,
Prashant
 
Share this answer
 
Comments
iyalarasi 19-Oct-12 2:24am    
I gave that but in error it shows Incorrect account name.
don't know what to do.Please give some link to find that.
PRASHANT KUMAR LAL 19-Oct-12 5:44am    
same code with my values are working fine :)
iyalarasi 22-Oct-12 0:17am    
did you run this application in windows mobile 6.5.3 professional edition? In which platform did you deploy this application? Please tell me.
It is not working for me.
Is that necessary to have outlook in mobile platform to run this application?
PRASHANT KUMAR LAL 22-Oct-12 3:00am    
no on IIS 7.5 not as mobile app :(
iyalarasi 22-Oct-12 3:29am    
now I am run this application,and now i got mail in mobile->outlook->outbox application. but i can't receive mail in my inbox in that mobile platform.
And I have one more doubt that,If I send mail from my mobile application, can we see that in my computer?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900