如何在邮件中发送数组 [英] How to send an array in a mail

查看:107
本文介绍了如何在邮件中发送数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友.

我想在邮件中发送数组值.
邮件正在正确发送,但是尽管显示了数组的内容,但邮件正文中仍显示了System.Array.

以下是我正在使用的代码

Hello friends.

I want to send an array value in the mail.
The mail is getting send properly but in spite of showing the contents of array it shows System.Array in the mail body.

Below is the code i am using

string callname = objAlert.GetLargeCallName(lasttime, Convert.ToDateTime(CurrentTime), myXmlSetting.LargeCallSize);
string[] call = callname.Split('/');

string strmgs = "Dear user," + "\r\n\r\n" + "\t" + "This is an auto generated email notification from CallConfine voice recording system to notify the concerned person that the Engine is recording large sized voice file( " + myXmlSetting.LargeCallSize + " Mb) since past   " + myXmlSetting.LargeCallFrequencyDuration + " hrs.\nThese are the file name "+call+ "Kindly check." + "\r\n\r\n\t\t" + "\r\n";



希望你们能理解我的问题

预先感谢.



hope you guys understand my problem

Thanks in advance.

推荐答案

string strmgs = string.Format("Dear user," + "\r\n\r\n" + "\tThis is an auto generated email notification from CallConfine voice recording system to notify the concerned person that the Engine is recording large sized voice file({0} Mb) since past {1} hrs.\nThese are the file name {2}. Kindly check." + "\r\n\r\n\t\t" + "\r\n", myXmlSetting.LargeCallSize, myXmlSetting.LargeCallFrequencyDuration, GetFileNames(call) );

private static string GetFileNames(string[] call)
{
string fileNames = string.Empty;
foreach (string str in call)
{
 fileNames += str + Environment.NewLine;
}

return fileNames;
}


更简单:
string call = callname.Replace("/", "\r\n");

>


这篇关于如何在邮件中发送数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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