Click here to Skip to main content
15,887,596 members
Home / Discussions / C#
   

C#

 
GeneralRe: string replace Pin
OriginalGriff16-Jul-18 23:39
mveOriginalGriff16-Jul-18 23:39 
GeneralRe: string replace Pin
Ali Doran17-Jul-18 5:03
Ali Doran17-Jul-18 5:03 
GeneralRe: string replace Pin
OriginalGriff17-Jul-18 5:10
mveOriginalGriff17-Jul-18 5:10 
QuestionMVC Website is working slow Pin
galba201815-Jul-18 21:12
galba201815-Jul-18 21:12 
AnswerRe: MVC Website is working slow Pin
Jochen Arndt15-Jul-18 23:56
professionalJochen Arndt15-Jul-18 23:56 
QuestionZoom Image in the PictureBox where user make selection Pin
Member 1384510215-Jul-18 4:26
Member 1384510215-Jul-18 4:26 
AnswerRe: Zoom Image in the PictureBox where user make selection Pin
Gerry Schmitz16-Jul-18 10:03
mveGerry Schmitz16-Jul-18 10:03 
QuestionCompiler Inside The Program got errors - Gmail Pin
Member 1385811014-Jul-18 7:58
Member 1385811014-Jul-18 7:58 
Hello Everyone!

I am using Visual C# to make a program, which compiles a code from string to export a new exe.
the first can update some configs for the second, when i try to run the second program i get this Exception:
The specified string is not in the form required for an e-mail address.


While the code is:
C#
 try
            {
                MailMessage mail = new MailMessage();
                SmtpClient SmtpServer = new SmtpClient(""smtp.gmail.com"");

                mail.From = new MailAddress(Config.username);
                mail.To.Add(Config.toEmail);
                mail.Subject = Config.subject; ;
                mail.Body = text;

                if (sendImage)
                {
                    var stream = new MemoryStream();
                    img.Save(stream, ImageFormat.Jpeg);
                    stream.Position = 0;
                    mail.Attachments.Add(new Attachment(stream, ""image / jpg""));
                }

                SmtpServer.Port = Config.smtpPort;
                SmtpServer.Credentials = new System.Net.NetworkCredential(Config.username, Config.password);
                SmtpServer.EnableSsl = true;

                SmtpServer.Send(mail);
Console.WriteLine(""Email has been sent!"");
            }
            catch (Exception e) { Console.WriteLine(e.Message); }



AnswerRe: Compiler Inside The Program got errors - Gmail Pin
OriginalGriff14-Jul-18 18:43
mveOriginalGriff14-Jul-18 18:43 
AnswerRe: Compiler Inside The Program got errors - Gmail Pin
Eddy Vluggen14-Jul-18 22:51
professionalEddy Vluggen14-Jul-18 22:51 
GeneralRe: Compiler Inside The Program got errors - Gmail Pin
Member 1385811015-Jul-18 1:11
Member 1385811015-Jul-18 1:11 
GeneralRe: Compiler Inside The Program got errors - Gmail Pin
Richard MacCutchan15-Jul-18 2:01
mveRichard MacCutchan15-Jul-18 2:01 
GeneralRe: Compiler Inside The Program got errors - Gmail Pin
Eddy Vluggen15-Jul-18 2:04
professionalEddy Vluggen15-Jul-18 2:04 
GeneralRe: Compiler Inside The Program got errors - Gmail Pin
Member 1385811015-Jul-18 2:58
Member 1385811015-Jul-18 2:58 
AnswerRe: Compiler Inside The Program got errors - Gmail Pin
Dave Kreskowiak16-Jul-18 4:29
mveDave Kreskowiak16-Jul-18 4:29 
QuestionStrings were not posted properly? Pin
codeNewer12-Jul-18 17:24
codeNewer12-Jul-18 17:24 
AnswerRe: Strings were not posted properly? Pin
Richard Deeming13-Jul-18 1:16
mveRichard Deeming13-Jul-18 1:16 
QuestionHow to select nodes via HtmlAgilityPack? Pin
MohammadRSZ12-Jul-18 12:54
MohammadRSZ12-Jul-18 12:54 
AnswerRe: How to select nodes via HtmlAgilityPack? Pin
Keviniano Gayo13-Jul-18 3:19
Keviniano Gayo13-Jul-18 3:19 
GeneralRe: How to select nodes via HtmlAgilityPack? Pin
MohammadRSZ13-Jul-18 5:07
MohammadRSZ13-Jul-18 5:07 
QuestionHow to uncompress zip file into a folder without external dependencies like Interop.Shell32.dll or 3rd-Party Assemblies? Pin
Kerem Guemruekcue11-Jul-18 18:58
Kerem Guemruekcue11-Jul-18 18:58 
AnswerRe: How to uncompress zip file into a folder without external dependencies like Interop.Shell32.dll or 3rd-Party Assemblies? Pin
Eddy Vluggen12-Jul-18 0:03
professionalEddy Vluggen12-Jul-18 0:03 
GeneralRe: How to uncompress zip file into a folder without external dependencies like Interop.Shell32.dll or 3rd-Party Assemblies? Pin
Kerem Guemruekcue12-Jul-18 0:29
Kerem Guemruekcue12-Jul-18 0:29 
GeneralRe: How to uncompress zip file into a folder without external dependencies like Interop.Shell32.dll or 3rd-Party Assemblies? Pin
Eddy Vluggen12-Jul-18 0:42
professionalEddy Vluggen12-Jul-18 0:42 
GeneralRe: How to uncompress zip file into a folder without external dependencies like Interop.Shell32.dll or 3rd-Party Assemblies? Pin
Kerem Guemruekcue12-Jul-18 1:13
Kerem Guemruekcue12-Jul-18 1:13 

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.