TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
A Repasky
NA
231
183.1k
New line not working in email
Sep 19 2012 1:43 PM
I have used the following code in many programs, but in this one program the newline does not work when sent my email, but works when written to a file. Why does it not work in this one program?
I hid the email addresses & relay. Thanks, arep
string
newline =
"\r\n"
;
string
message1 =
"Success - Weekly "
+ name +
" Claims Extract Succeeded"
;
string
message2 = name +
" Extract Succeeded"
+ newline +
"Start Time: "
+ stime
+ newline +
"Finish Time: "
+ etime
+ newline +
"Run Time: "
+ span.ToString(
"c"
)
+ newline +
"Record Count: "
+ recnt.ToString()
+ newline +
"************************************************************************"
;
Output_Files
.PrintLog(message1);
Output_Files
.PrintLog(message2);
SendEmail(message1, message2);
public
static
void
SendEmail(
string
subject,
string
body)
{
// create mail message object
MailMessage
mail =
new
MailMessage
();
MailAddress
maddr =
new
MailAddress
(
"emailaddress"
);
mail.From = maddr;
// put the from address here
mail.To.Add(
"emailaddress"
);
// put to address here
mail.Subject = subject;
// put subject here
mail.Body = body;
// put body of email here
SmtpClient
smtpMail =
new
SmtpClient
(
"smtprelay"
);
// put smtp server you will use here
// and then send the mail
smtpMail.Send(mail);
}
Reply
Answers (
4
)
c# private assembly and shared assembly
how to run a exe file in jpg