send mail with format
-
Hi experts, I am retriving few values which is stored in database like, ----------------------------------------------- Hi, This is the format of Username and Password UserName : xyz Password : *** Regards, ------------------------------------------------ but when email is sent it comes as, ------------------------------------------------ Hi,This is the format of Username and Password UserName : xyzPassword : *** Regards, ------------------------------------------------ how to send mail like the original format. i can't include
orbecause this content is changable. i have also tried "mailMsg.BodyFormat = MailFormat.Html; " Please guide me......
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
-
Hi experts, I am retriving few values which is stored in database like, ----------------------------------------------- Hi, This is the format of Username and Password UserName : xyz Password : *** Regards, ------------------------------------------------ but when email is sent it comes as, ------------------------------------------------ Hi,This is the format of Username and Password UserName : xyzPassword : *** Regards, ------------------------------------------------ how to send mail like the original format. i can't include
orbecause this content is changable. i have also tried "mailMsg.BodyFormat = MailFormat.Html; " Please guide me......
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
string message =""; message=""+ "" + "
UserName:
your username text
Password:
your password
"; Try like this .............
-
Hi experts, I am retriving few values which is stored in database like, ----------------------------------------------- Hi, This is the format of Username and Password UserName : xyz Password : *** Regards, ------------------------------------------------ but when email is sent it comes as, ------------------------------------------------ Hi,This is the format of Username and Password UserName : xyzPassword : *** Regards, ------------------------------------------------ how to send mail like the original format. i can't include
orbecause this content is changable. i have also tried "mailMsg.BodyFormat = MailFormat.Html; " Please guide me......
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
If you are using HTMLFormat you need to supply HTML format, you know, like in a webpage.
I know the language. I've read a book. - _Madmatt
-
If you are using HTMLFormat you need to supply HTML format, you know, like in a webpage.
I know the language. I've read a book. - _Madmatt
thanks for your reply, actually i too have formatted but the values are editable by the end user. They can give any type of words.......
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
-
string message =""; message=""+ "" + "
UserName:
your username text
Password:
your password
"; Try like this .............
actually i too have formatted but the values are editable by the end user. They can give any type of words.......
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
-
thanks for your reply, actually i too have formatted but the values are editable by the end user. They can give any type of words.......
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
Then you'll need to come up with a parsing engine to format the input appropriately.
I know the language. I've read a book. - _Madmatt
-
Then you'll need to come up with a parsing engine to format the input appropriately.
I know the language. I've read a book. - _Madmatt
can you just explain in detail
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
-
can you just explain in detail
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
If you want me to do the work, then contact me and we'll discuss rates
I know the language. I've read a book. - _Madmatt
-
Hi experts, I am retriving few values which is stored in database like, ----------------------------------------------- Hi, This is the format of Username and Password UserName : xyz Password : *** Regards, ------------------------------------------------ but when email is sent it comes as, ------------------------------------------------ Hi,This is the format of Username and Password UserName : xyzPassword : *** Regards, ------------------------------------------------ how to send mail like the original format. i can't include
orbecause this content is changable. i have also tried "mailMsg.BodyFormat = MailFormat.Html; " Please guide me......
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
string msgBody = string.Format(@"Hi,
This is the format of Username and Password
UserName : {0}
Password : {1}
",yourUserNameVariable, yourPasswordVariable);If you are saying the users can change the entire message (probably a bad idea) then you need to come up with some formatting engine somewhat like these forums where you can insert certain codes to get smileys or other formatting things.
-
Hi experts, I am retriving few values which is stored in database like, ----------------------------------------------- Hi, This is the format of Username and Password UserName : xyz Password : *** Regards, ------------------------------------------------ but when email is sent it comes as, ------------------------------------------------ Hi,This is the format of Username and Password UserName : xyzPassword : *** Regards, ------------------------------------------------ how to send mail like the original format. i can't include
orbecause this content is changable. i have also tried "mailMsg.BodyFormat = MailFormat.Html; " Please guide me......
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
padmanabhan N wrote:
i have also tried "mailMsg.BodyFormat = MailFormat.Html; "
You may have tried this, but did you include some HTML tags in your code as well? Because just saying it should be HTML doesn't make it HTML in a flash, you'll need to code your text in HTML. IE: Let's say you username variable is a string _username, and you password is a string _password. Then try the following (in asp.net/c#): On top of your page:
using System.Net.Mail
then in your SendMail method:
private void SendMail(string _username, string _password)
{
string MailBody = "Hi,This is the format of Username and Password
UserName : " + _username + "
";
MailBody += "Password : " + _password + "Regards,";
MailMessage MMsg = new MailMessage();
MMsg.From = new MailAddress("youmailadress@youmailprovider.com");
MMsg.To.Add(new MailAddress("therecievingadress@therecievingdomain.com"));
MMsg.Subject = "Your subject";
MMsg.IsBodyHtml = true; //This is what makes your e-mail HTML formatted.
MMsg.Body = MailBody; //The content of your e-mail
SmtpClient SMTPSender = new SmtpClient();
SMTPSender.Host = "your mailhost"; //this is often "localhost"
SMTPSender.Send(MMsg);
}Hope this helps.
"My personality is not represented by my hometown."