Click here to Skip to main content
14,926,738 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to Fill GridView Fast Pin
Anurag Gandhi8-Mar-10 1:59
professionalAnurag Gandhi8-Mar-10 1:59 
AnswerRe: How to Fill GridView Fast Pin
Brij8-Mar-10 2:34
mentorBrij8-Mar-10 2:34 
AnswerRe: How to Fill GridView Fast Pin
R. Giskard Reventlov8-Mar-10 2:41
MemberR. Giskard Reventlov8-Mar-10 2:41 
QuestionGetting Error "Internal .Net Framework Data Provider error 12." Pin
krishnaveer8-Mar-10 0:10
Memberkrishnaveer8-Mar-10 0:10 
QuestionHow to call Activex Control methods using javascripts? Pin
Prasadsm8-Mar-10 0:04
MemberPrasadsm8-Mar-10 0:04 
AnswerRe: How to call Activex Control methods using javascripts? Pin
Anurag Gandhi8-Mar-10 2:04
professionalAnurag Gandhi8-Mar-10 2:04 
GeneralRe: How to call Activex Control methods using javascripts? Pin
Prasadsm8-Mar-10 2:17
MemberPrasadsm8-Mar-10 2:17 
QuestionSend email with Cc and Bcc using smtpmail class smtpmail.smtpserver 127.0.0.1 Pin
Member 42883237-Mar-10 23:39
MemberMember 42883237-Mar-10 23:39 
Hello,
i have code to send smtp mail from local system and from configured server.

when i use to send email with all options like from,to,cc and bcc as per the below code
local server(system code works like)

Configuration configurationFile = WebConfigurationManager.OpenWebConfiguration("~/Web.config");
 MailSettingsSectionGroup mailSettings = configurationFile.GetSectionGroup("system.net/mailSettings") as MailSettingsSectionGroup;
                    if (mailSettings != null)
                    {
                        port = mailSettings.Smtp.Network.Port;
                        host = mailSettings.Smtp.Network.Host;
                        password = mailSettings.Smtp.Network.Password;
                        username = mailSettings.Smtp.Network.UserName;
                    }

                    MailMessage message = new MailMessage(FromAddress, ToAddress, EMailSubject, EMailBody);

                    if (string.IsNullOrEmpty(ToAddress))
                    {
                        message.To.Clear();
                        message.CC.Clear();
                    }
                    else
                    {
                        message.CC.Add(ToAddress);
                        message.To.Clear();
                    }

                    if (!string.IsNullOrEmpty(BccAddress))
                        message.Bcc.Add(BccAddress);

                    message.IsBodyHtml = IsHTMLFormat;
                    SmtpClient mySMTPclient = new SmtpClient(host, port);
                    NetworkCredential userCredetials = new NetworkCredential(username, password);
                    mySMTPclient.UseDefaultCredentials = false;
                    mySMTPclient.Credentials = userCredetials;

                    mySMTPclient.EnableSsl = true;
                    mySMTPclient.Send(message);

then it is working fine.

from the above code all the mails will be sent from one singe from address like "abc.gmail.com" irrespective of from address at runtime.

from the hosting server
to accomplish this i have used code as below

System.Web.Mail.MailMessage mailMessage = new System.Web.Mail.MailMessage();
                   mailMessage.From = FromAddress;

                   if (!string.IsNullOrEmpty(BccAddress))
                   {
                       BccAddress = BccAddress.Replace(",", ";");
                       mailMessage.Bcc = BccAddress;
                   }

                   if (!string.IsNullOrEmpty(ToAddress))
                   {
                       ToAddress = ToAddress.Replace(",", ";");
                       mailMessage.Cc = ToAddress;
                   }

                   mailMessage.Subject = EMailSubject;
                   mailMessage.Body = EMailBody;
                   if (IsHTMLFormat)
                       mailMessage.BodyFormat = System.Web.Mail.MailFormat.Html;
                   else
                       mailMessage.BodyFormat = System.Web.Mail.MailFormat.Text;
                   mailMessage.Priority = System.Web.Mail.MailPriority.Normal;
                   System.Web.Mail.SmtpMail.SmtpServer = "127.0.0.1";
                   System.Web.Mail.SmtpMail.Send(mailMessage);

mails will be sent from the user who ever sends.
but the problem is what ever email have added to Bcc are not sent and rest from and cc are working fine.

this is very important to me because we intend to stop release because of this.

any solution would be highly appreciated.
AnswerRe: Send email with Cc and Bcc using smtpmail class smtpmail.smtpserver 127.0.0.1 Pin
Abhijit Jana8-Mar-10 0:33
professionalAbhijit Jana8-Mar-10 0:33 
GeneralRe: Send email with Cc and Bcc using smtpmail class smtpmail.smtpserver 127.0.0.1 Pin
Member 42883238-Mar-10 18:48
MemberMember 42883238-Mar-10 18:48 
Questionhow to save image in sql server using asp.net with c# Pin
developerit7-Mar-10 20:31
Memberdeveloperit7-Mar-10 20:31 
AnswerRe: how to save image in sql server using asp.net with c# Pin
Vimalsoft(Pty) Ltd7-Mar-10 20:52
professionalVimalsoft(Pty) Ltd7-Mar-10 20:52 
AnswerRe: how to save image in sql server using asp.net with c# Pin
Brij7-Mar-10 20:56
mentorBrij7-Mar-10 20:56 
AnswerRe: how to save image in sql server using asp.net with c# Pin
sashidhar7-Mar-10 23:10
Membersashidhar7-Mar-10 23:10 
GeneralRe: how to save image in sql server using asp.net with c# Pin
developerit8-Mar-10 18:29
Memberdeveloperit8-Mar-10 18:29 
AnswerRe: how to save image in sql server using asp.net with c# Pin
awadhendra tiwari23-May-11 7:02
Memberawadhendra tiwari23-May-11 7:02 
QuestionHow to send a post request from one server to another Pin
vnr7-Mar-10 19:49
Membervnr7-Mar-10 19:49 
AnswerRe: How to send a post request from one server to another Pin
sashidhar7-Mar-10 23:32
Membersashidhar7-Mar-10 23:32 
QuestionASP.NET Page refresh and result Pin
AnthonyMG7-Mar-10 19:23
MemberAnthonyMG7-Mar-10 19:23 
AnswerRe: ASP.NET Page refresh and result Pin
Vimalsoft(Pty) Ltd7-Mar-10 20:38
professionalVimalsoft(Pty) Ltd7-Mar-10 20:38 
GeneralRe: ASP.NET Page refresh and result Pin
sowjanya37-Mar-10 23:41
Membersowjanya37-Mar-10 23:41 
AnswerRe: ASP.NET Page refresh and result Pin
Brij7-Mar-10 20:50
mentorBrij7-Mar-10 20:50 
GeneralRe: ASP.NET Page refresh and result Pin
sowjanya37-Mar-10 23:30
Membersowjanya37-Mar-10 23:30 
GeneralRe: ASP.NET Page refresh and result Pin
sowjanya37-Mar-10 23:31
Membersowjanya37-Mar-10 23:31 
GeneralRe: ASP.NET Page refresh and result Pin
Brij7-Mar-10 23:38
mentorBrij7-Mar-10 23:38 

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.