本文整理汇总了C#中Amazon.SimpleEmail.AmazonSimpleEmailServiceConfig类的典型用法代码示例。如果您正苦于以下问题:C# AmazonSimpleEmailServiceConfig类的具体用法?C# AmazonSimpleEmailServiceConfig怎么用?C# AmazonSimpleEmailServiceConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AmazonSimpleEmailServiceConfig类属于Amazon.SimpleEmail命名空间,在下文中一共展示了AmazonSimpleEmailServiceConfig类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateAmazonSimpleEmailServiceClient
/// <summary>
/// Create a client for the Amazon SimpleEmailService Service with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSAccessKey" value="********************"/>
/// <add key="AWSSecretKey" value="****************************************"/>
/// </appSettings>
/// </configuration>
/// </code>
/// </summary>
/// <param name="config">Configuration options for the service like HTTP Proxy, # of connections, etc</param>
/// <returns>An Amazon SimpleEmailService client</returns>
public static AmazonSimpleEmailService CreateAmazonSimpleEmailServiceClient(AmazonSimpleEmailServiceConfig config)
{
return new AmazonSimpleEmailServiceClient(config);
}
开发者ID:rguarino4,项目名称:aws-sdk-net,代码行数:21,代码来源:AWSClientFactory.cs
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
AmazonSimpleEmailServiceConfig amConfig = new AmazonSimpleEmailServiceConfig();
amConfig.UseSecureStringForAwsSecretKey = false;
AmazonSimpleEmailServiceClient amzClient = new AmazonSimpleEmailServiceClient(ConfigurationManager.AppSettings["AWSAccessKey"].ToString(), ConfigurationManager.AppSettings["AWSSecretKey"].ToString(),amConfig);
ArrayList to = new ArrayList();
//ADD AS TO 50 emails per one sending method//////////////////////
//to.Add("[email protected]");
//to.Add("[email protected]");
to.Add("[email protected]");
to.Add("[email protected]");
to.Add("[email protected]");
to.Add("[email protected]");
to.Add("[email protected]");
to.Add("[email protected]");
Destination dest = new Destination();
dest.WithToAddresses((string[])to.ToArray(typeof(string)));
//dest.WithToAddresses((string[])to.ToArray(typeof(string)));
string body = "INSERT HTML BODY HERE";
string subject = "INSERT EMAIL SUBJECT HERE";
Body bdy = new Body();
bdy.Html = new Amazon.SimpleEmail.Model.Content(body);
Amazon.SimpleEmail.Model.Content title = new Amazon.SimpleEmail.Model.Content(subject);
Message message = new Message(title, bdy);
//VerifyEmailAddressRequest veaRequest = new VerifyEmailAddressRequest();
// veaRequest.EmailAddress = "[email protected]";
// VerifyEmailAddressResponse veaResponse = amzClient.VerifyEmailAddress(veaRequest);
SendEmailRequest ser = new SendEmailRequest("[email protected]", dest, message);
ser.WithReturnPath("[email protected]");
SendEmailResponse seResponse = amzClient.SendEmail(ser);
SendEmailResult seResult = seResponse.SendEmailResult;
//GetSendStatisticsRequest request=new GetSendStatisticsRequest();
//GetSendStatisticsResponse obj = amzClient.GetSendStatistics(request);
//List<SendDataPoint> sdata = new List<SendDataPoint>();
//sdata=obj.GetSendStatisticsResult.SendDataPoints;
//Int64 sentCount = 0,BounceCount=0,DeleveryAttempts=0;
//for (int i = 0; i < sdata.Count; i++)
//{
// BounceCount = BounceCount +sdata[i].Bounces;
// DeleveryAttempts = DeleveryAttempts + sdata[i].DeliveryAttempts;
//}
//sentCount = DeleveryAttempts - BounceCount;
}
开发者ID:shekar348,项目名称:1PointOne,代码行数:53,代码来源:AWS2.aspx.cs
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
AmazonSimpleEmailServiceConfig amConfig = new AmazonSimpleEmailServiceConfig();
amConfig.UseSecureStringForAwsSecretKey = false;
AmazonSimpleEmailServiceClient amzClient = new AmazonSimpleEmailServiceClient(ConfigurationManager.AppSettings["AWSAccessKey"].ToString(), ConfigurationManager.AppSettings["AWSSecretKey"].ToString(), amConfig);
ArrayList to = new ArrayList();
to.Add("[email protected]");
//to.Add("[email protected]");
for (int i = 0; i < to.Count; i++)
{
Destination dest = new Destination();
dest.WithToAddresses(to[i].ToString());
string body = "Hello this is testing AWS";
string subject = "Test AWS";
Body bdy = new Body();
bdy.Html = new Amazon.SimpleEmail.Model.Content(body);
Amazon.SimpleEmail.Model.Content title = new Amazon.SimpleEmail.Model.Content(subject);
Message message = new Message(title, bdy);
SendEmailRequest ser = new SendEmailRequest("[email protected]", dest, message);
ser.WithReturnPath("[email protected]");
SendEmailResponse seResponse = amzClient.SendEmail(ser);
SendEmailResult seResult = seResponse.SendEmailResult;
}
//GetSendStatisticsRequest request = new GetSendStatisticsRequest();
//GetSendStatisticsResponse obj = amzClient.GetSendStatistics(request);
//List<SendDataPoint> sdata = new List<SendDataPoint>();
//sdata = obj.GetSendStatisticsResult.SendDataPoints;
//Int64 sentCount = 0, BounceCount = 0, DeleveryAttempts = 0;
//for (int i = 0; i < sdata.Count; i++)
//{
// BounceCount = BounceCount + sdata[i].Bounces;
// DeleveryAttempts = DeleveryAttempts + sdata[i].DeliveryAttempts;
//}
//sentCount = DeleveryAttempts - BounceCount;
}
开发者ID:shekar348,项目名称:1PointOne,代码行数:37,代码来源:AWS3.aspx.cs
示例4: AmazonSimpleEmailServiceClient
/// <summary>
/// Constructs AmazonSimpleEmailServiceClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonSimpleEmailServiceClient Configuration object.
/// </summary>
/// <param name="awsAccessKeyId">AWS Access Key ID</param>
/// <param name="awsSecretAccessKey">AWS Secret Access Key</param>
/// <param name="awsSessionToken">AWS Session Token</param>
/// <param name="clientConfig">The AmazonSimpleEmailServiceClient Configuration Object</param>
public AmazonSimpleEmailServiceClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonSimpleEmailServiceConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig, AuthenticationTypes.User | AuthenticationTypes.Session)
{
}
开发者ID:rsparkyc,项目名称:aws-sdk-net,代码行数:12,代码来源:AmazonSimpleEmailServiceClient.cs
示例5: SendEmail
public bool SendEmail()
{
//INITIALIZE AWS CLIENT//
AmazonSimpleEmailServiceConfig amConfig = new AmazonSimpleEmailServiceConfig();
//amConfig.UseSecureStringForAwsSecretKey = false;
AmazonSimpleEmailServiceClient amzClient = new AmazonSimpleEmailServiceClient(
AppSettingHelper.GetAmazonAccessKey(),AppSettingHelper.GetAmazonSecretKey(),//ConfigurationManager.AppSettings["AWSAccessKey"].ToString(),
RegionEndpoint.USEast1);// ConfigurationManager.AppSettings["AWSSecretKey"].ToString(), amConfig);
//ArrayList that holds To Emails. It can hold 1 Email to any
//number of emails in case what to send same message to many users.
var to = new List<string>();
to.Add("[email protected]");
//Create Your Bcc Addresses as well as Message Body and Subject
Destination dest = new Destination();
dest.BccAddresses.Add("[email protected]");
//string body = Body;
string subject = "Subject : " + "Demo Mail";
Body bdy = new Body();
bdy.Html = new Amazon.SimpleEmail.Model.Content("Test Mail");
Amazon.SimpleEmail.Model.Content title = new Amazon.SimpleEmail.Model.Content(subject);
Message message = new Message(title, bdy);
//Create A Request to send Email to this ArrayList with this body and subject
try
{
SendEmailRequest ser = new SendEmailRequest("[email protected]", dest, message);
SendEmailResponse seResponse = amzClient.SendEmail(ser);
// SendEmailResult seResult = seResponse.SendEmailResult;
}
catch (Exception ex)
{
}
return true;
}
开发者ID:gitAakash,项目名称:UnSeenTalents,代码行数:38,代码来源:UnseenTalentsMethod.cs
示例6: CreateAmazonSimpleEmailServiceClient
/// <summary>
/// Create a client for the Amazon SimpleEmailService Service with AWSCredentials and an AmazonSimpleEmailService Configuration object.
/// </summary>
/// <param name="credentials">AWS Credentials</param>
/// <param name="config">Configuration options for the service like HTTP Proxy, # of connections, etc</param>
/// <returns>An Amazon SimpleEmailService client</returns>
/// <remarks>
/// </remarks>
public static IAmazonSimpleEmailService CreateAmazonSimpleEmailServiceClient(AWSCredentials credentials, AmazonSimpleEmailServiceConfig config)
{
return new AmazonSimpleEmailServiceClient(credentials, config);
}
开发者ID:sadiqj,项目名称:aws-sdk-xamarin,代码行数:12,代码来源:AWSClientFactory.cs
示例7: AmazonSimpleEmailServiceClient
/// <summary>
/// Constructs AmazonSimpleEmailServiceClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonSimpleEmailServiceClient Configuration object.
/// </summary>
/// <param name="awsAccessKeyId">AWS Access Key ID</param>
/// <param name="awsSecretAccessKey">AWS Secret Access Key</param>
/// <param name="awsSessionToken">AWS Session Token</param>
/// <param name="clientConfig">The AmazonSimpleEmailServiceClient Configuration Object</param>
public AmazonSimpleEmailServiceClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonSimpleEmailServiceConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig)
{
}
开发者ID:aws,项目名称:aws-sdk-net,代码行数:12,代码来源:AmazonSimpleEmailServiceClient.cs
示例8: CreateAmazonSes
private AmazonSimpleEmailService CreateAmazonSes(Ec2Key ec2Key)
{
var sesConfig = new AmazonSimpleEmailServiceConfig();
AmazonSimpleEmailService ses = AWSClientFactory.CreateAmazonSimpleEmailServiceClient(ec2Key.AwsAccessKey, ec2Key.AwsSecretKey, sesConfig);
return ses;
}
开发者ID:escherrer,项目名称:EC2Utilities,代码行数:7,代码来源:Ec2ResourceAccess.cs
示例9: Register
public ActionResult Register(RegisterModel model)
{
if (ModelState.IsValid)
{
// 尝试注册用户
MembershipCreateStatus createStatus;
Membership.CreateUser(model.UserName, model.Password, model.Email, null, null, true, null, out createStatus);
if (createStatus == MembershipCreateStatus.Success)
{
//Send email by amazon ses
string accessKey = "AKIAIO4BEQ2UGFAMHRFQ";
string secretAccessKey = "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";
AmazonSimpleEmailServiceConfig amazonConfiguration = new AmazonSimpleEmailServiceConfig();
AmazonSimpleEmailServiceClient clientMail = new AmazonSimpleEmailServiceClient(accessKey, secretAccessKey, amazonConfiguration);
Destination destination = new Destination();
destination.ToAddresses.Add(model.Email);
Body body = new Body() { Html = new Content("Welcome to AIRPDF "+"Your account is: "+model.UserName+" Your password is: "+model.ConfirmPassword) };
Content subject = new Content("Welcome to AIRPDF!");
Message message = new Message(subject, body);
SendEmailRequest sendEmailRequest = new SendEmailRequest("[email protected]", destination, message);
clientMail.SendEmail(sendEmailRequest);
FormsAuthentication.SetAuthCookie(model.UserName, false /* createPersistentCookie */);
return RedirectToAction("Index", "pdf");
}
else
{
ModelState.AddModelError("", ErrorCodeToString(createStatus));
}
}
// 如果我们进行到这一步时某个地方出错,则重新显示表单
return View(model);
}
开发者ID:airpdf,项目名称:AIR_PDF_REPO,代码行数:35,代码来源:AccountController.cs
示例10: AmazonSimpleEmailServiceClient
/// <summary>
/// Constructs AmazonSimpleEmailServiceClient with the credentials defined in the App.config.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSAccessKey" value="********************"/>
/// <add key="AWSSecretKey" value="****************************************"/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
/// <param name="config">The AmazonSimpleEmailService Configuration Object</param>
public AmazonSimpleEmailServiceClient(AmazonSimpleEmailServiceConfig config)
: base(new EnvironmentAWSCredentials(), config, true, AuthenticationTypes.User)
{
}
开发者ID:nburn42,项目名称:aws-sdk-for-net,代码行数:20,代码来源:AmazonSimpleEmailServiceClient.cs
注:本文中的Amazon.SimpleEmail.AmazonSimpleEmailServiceConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论