帮助将varibles插入电子邮件正文 [英] Help with inserting varibles into an email body

查看:61
本文介绍了帮助将varibles插入电子邮件正文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,我使用c#而且我有问题。我需要发送一封电子邮件,其中包含用户放入文本框的内容。我已经研究了如何发送电子邮件,这一切都很好,但我似乎无法将用户输入的内容放入电子邮件中。我有字符串a,b,c和d。我可以将任何普通文本放入:const string body =(Hi!);但我不能放入我的四个变量。我在编码方面是一个非常大的菜鸟,所以我不确定它们是否被称为字符串或变量或两者,但我认为你会得到我的意思。

Hey guys, im using c# and I have a problem. I need to send an email with things the user has put into text boxes. I have worked out how to send the email and that's all good, but I can't seem to put the things the user has entered into the email.I have string a, b, c and d. I can put any normal text in: const string body = ("Hi!"); but i cant put in my four varibles. I am a really big noob at coding so im not sure if they are called strings or varibles or both but i think you will get what i mean.

推荐答案

尝试:

Try:
string body = string.Format("Hi {0}!<br />Welcome to my Web site.<br />{1} + {2} = {3}", a, b, c, d);


这篇关于帮助将varibles插入电子邮件正文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆