Click here to Skip to main content
15,904,494 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Suggestions for displaying search results like Google? Pin
Jay Royall10-Sep-09 23:08
Jay Royall10-Sep-09 23:08 
AnswerRe: Suggestions for displaying search results like Google? Pin
Manas Bhardwaj10-Sep-09 23:13
professionalManas Bhardwaj10-Sep-09 23:13 
Questioncrystal report Pin
ankitjain111010-Sep-09 22:59
ankitjain111010-Sep-09 22:59 
AnswerRe: crystal report Pin
mr_muskurahat10-Sep-09 23:28
mr_muskurahat10-Sep-09 23:28 
QuestionHelp - Remoting Pin
vishwjeet10-Sep-09 22:57
vishwjeet10-Sep-09 22:57 
AnswerRe: Help - Remoting Pin
Abhishek Sur10-Sep-09 23:50
professionalAbhishek Sur10-Sep-09 23:50 
GeneralRe: Help - Remoting Pin
vishwjeet11-Sep-09 0:01
vishwjeet11-Sep-09 0:01 
QuestionURI Format Not Supported. [modified] Pin
Meetu Choudhary10-Sep-09 22:03
Meetu Choudhary10-Sep-09 22:03 
I am Sending a Mail with attachemts for this I have Made A WCF Which works fine when I give the Network path of the file. but I need to host It And when I try to give a URL path It Says. URI format not supported please Help My Code in WCF

  public List<string> funSendMail(Mailcls m)<br />
        {<br />
            List<string> result = new List<string>();<br />
            try<br />
            {<br />
                /* Create a new blank MailMessage with the from and to adreesses*/<br />
                System.Net.Mail.MailMessage mailMessage = new System.Net.Mail.MailMessage(m.Sender, m.Receiver);<br />
                /*Checking the condition that the cc is empty or not if not then<br />
                 * include them<br />
                 */<br />
                if (m.Cc != null && m.Cc != string.Empty)<br />
                {<br />
                    mailMessage.CC.Add(m.Cc);<br />
                }<br />
                /*Checking the condition that the Bcc is empty or not if not then<br />
                 * include them<br />
                 */<br />
                if (m.Bcc != null && m.Bcc != string.Empty)<br />
                {<br />
                    mailMessage.Bcc.Add(m.Bcc);<br />
                }<br />
                //Ading Subject to the Mail<br />
                mailMessage.Subject = m.Subject;<br />
                //Adding the Mail Body<br />
                mailMessage.Body = m.Body;<br />
<br />
                /* Set the properties of the MailMessage to the<br />
                   values on the form as per the mail is HTML formatted */<br />
<br />
                mailMessage.IsBodyHtml = true;<br />
<br />
<br />
                /* Bigining of Attachment1 process   & <br />
                   Check the all file for a attachment */<br />
<br />
                if ((m.AttachfilesPath != null) && (m.AttachfilesPath.Count > 0))<br />
                {<br />
                    foreach (string s in m.AttachfilesPath)<br />
                    {<br />
                        result.Add("Attaching File : " + s);<br />
                       <br />
                        System.Net.Mail.Attachment attach = new System.Net.Mail.Attachment(s);                        <br />
                        /* Attach the newly created email attachment */<br />
                        mailMessage.Attachments.Add(attach);<br />
                    }<br />
<br />
                }<br />
<br />
                /* Set the SMTP server and send the email with attachment */<br />
                System.Net.Mail.SmtpClient smtpClient = new System.Net.Mail.SmtpClient();<br />
                // smtpClient.Host = emailServerInfo.MailServerIP;<br />
                //this will be the host in case of gamil and it varies from the service provider<br />
                smtpClient.Host = m.Host;<br />
                //smtpClient.Port = Convert.ToInt32(emailServerInfo.MailServerPortNumber);<br />
                //this will be the port in case of gamil for dotnet and it varies from the service provider<br />
                smtpClient.Port = m.Port;<br />
                smtpClient.UseDefaultCredentials = true;<br />
                //smtpClient.Credentials = new System.Net.NetworkCredential(emailServerInfo.MailServerUserName, emailServerInfo.MailServerPassword);<br />
                smtpClient.Credentials = new System.Net.NetworkCredential(m.UserName, m.Password);<br />
                //this will be the true in case of gamil and it varies from the service provider<br />
                smtpClient.EnableSsl = m.SSL;<br />
                smtpClient.Send(mailMessage);<br />
<br />
                try<br />
                {<br />
<br />
                    /* Delete the attachements if any */<br />
                    foreach (string s in m.AttachfilesPath)<br />
                    {<br />
                        File.Delete(s);<br />
                    }<br />
                }<br />
                catch { }<br />
                result.Add("1");<br />
<br />
            }<br />
            catch (Exception ex)<br />
            {<br />
                result.Add("-2 " + ex.Message);<br />
            }<br />
            return result;<br />
<br />
        }

and In Calling Appication (Which is a Silverlight Application)


ObservableCollection<string> cv = new ObservableCollection<String>();<br />
            //cv.Add(@"\\C6\Shared\Repo\a\Drafts\go.png");//This Works<br />
            cv.Add(@"www.msdotnetmentor.com/wp-content/uploads/2009/08/5.JPG");//This Doesnot Work<br />
            Mail.Bcc = txtBCC.Text;<br />
            Mail.Body = txtMailBody.Text;<br />
            Mail.Cc = txtCC.Text;<br />
            //Mail.AttachfilesPath = SendDraftAttachment;<br />
            Mail.AttachfilesPath = cv;<br />
            Mail.Host = EditDeleteEmailConfig.SMTPHost;<br />
            Mail.Password = EditDeleteEmailConfig.SMTPPassword;<br />
            Mail.Port = EditDeleteEmailConfig.SMTPPort;<br />
            Mail.Receiver = txtTo.Text;<br />
            Mail.Sender = txtFrom.Text;<br />
            Mail.SSL = EditDeleteEmailConfig.SMTPSSL;<br />
            Mail.Subject = txtSubject.Text;<br />
            Mail.UserName = EditDeleteEmailConfig.SMTPUserName;<br />
            SuccessMessage = "Mail Sent Successfully";<br />
            ErrorMessage = "Error In Sending Mail" + Environment.NewLine + "Try Sending Later";<br />
            if (EmailSettings)<br />
            {<br />
                SendClient.funSendMailAsync(Mail);<br />
                SendClient.funSendMailCompleted += new EventHandler<funSendMailCompletedEventArgs>(SendClient_funSendMailCompleted);<br />
            }<br />
            else<br />
            {<br />
                EditDeleteEmailConfig = new EmailConfig();<br />
                IsSendMail = true;<br />
                EmailSettingsClient.GetEamilConfigByClientIdAsync(userID);<br />
            }


Thanks and Regards
Meetu Choudhary
My Web || My Blog || My Forums

modified on Friday, September 11, 2009 8:56 AM

AnswerRe: URI Format Not Supported. Pin
Christian Graus10-Sep-09 22:28
protectorChristian Graus10-Sep-09 22:28 
GeneralRe: URI Format Not Supported. Pin
Meetu Choudhary10-Sep-09 22:30
Meetu Choudhary10-Sep-09 22:30 
GeneralRe: URI Format Not Supported. Pin
Christian Graus10-Sep-09 22:36
protectorChristian Graus10-Sep-09 22:36 
GeneralRe: URI Format Not Supported. Pin
Meetu Choudhary10-Sep-09 22:41
Meetu Choudhary10-Sep-09 22:41 
GeneralRe: URI Format Not Supported. Pin
Christian Graus10-Sep-09 22:45
protectorChristian Graus10-Sep-09 22:45 
GeneralRe: URI Format Not Supported. Pin
Meetu Choudhary10-Sep-09 22:47
Meetu Choudhary10-Sep-09 22:47 
GeneralRe: URI Format Not Supported. Pin
Christian Graus10-Sep-09 22:49
protectorChristian Graus10-Sep-09 22:49 
GeneralRe: URI Format Not Supported. Pin
Meetu Choudhary10-Sep-09 22:50
Meetu Choudhary10-Sep-09 22:50 
GeneralRe: URI Format Not Supported. Pin
Christian Graus10-Sep-09 22:51
protectorChristian Graus10-Sep-09 22:51 
GeneralRe: URI Format Not Supported. Pin
Meetu Choudhary10-Sep-09 22:54
Meetu Choudhary10-Sep-09 22:54 
AnswerRe: URI Format Not Supported. Pin
vishwjeet10-Sep-09 23:04
vishwjeet10-Sep-09 23:04 
GeneralRe: URI Format Not Supported. Pin
Meetu Choudhary10-Sep-09 23:38
Meetu Choudhary10-Sep-09 23:38 
GeneralRe: URI Format Not Supported. Pin
vishwjeet11-Sep-09 0:03
vishwjeet11-Sep-09 0:03 
GeneralRe: URI Format Not Supported. Pin
Meetu Choudhary11-Sep-09 0:06
Meetu Choudhary11-Sep-09 0:06 
GeneralRe: URI Format Not Supported. Pin
vishwjeet11-Sep-09 1:52
vishwjeet11-Sep-09 1:52 
GeneralRe: URI Format Not Supported. Pin
Meetu Choudhary11-Sep-09 1:56
Meetu Choudhary11-Sep-09 1:56 
GeneralRe: URI Format Not Supported. Pin
vishwjeet11-Sep-09 2:00
vishwjeet11-Sep-09 2:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.