1

I am trying to send an SMS message to a phone number in asp.net mvc.

I am getting issue of a phone number in the publish object.

"Publish Request does not contain a defination of Phone Number."

  using Amazon.SimpleNotificationService;
  using Amazon.SimpleNotificationService.Model;
 string number = "00000000";
 string message = "Hello at " + DateTime.Now.ToShortTimeString();
 var client = new AmazonSimpleNotificationServiceClient(region: 
              Amazon.RegionEndpoint.USEast1);
 var request = new PublishRequest
 {
    Message = message,
    PhoneNumber = number
  };
  var response = client.Publish(request);
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
nawaz uddin
  • 345
  • 2
  • 14
  • Yes I am adding the country code – nawaz uddin Sep 19 '22 at 14:34
  • You could check this out and see if it helps: [amazon-sms-for-single-number-from-c-sharp-sdk-without-creating-topic](https://stackoverflow.com/questions/42140305/amazon-sms-for-single-number-from-c-sharp-sdk-without-creating-topic) – Ryan Wilson Sep 19 '22 at 14:46
  • Also, check your versioning: [phonenumber-is-not-a-member-of-publishrequest-aws](https://stackoverflow.com/questions/59720875/phonenumber-is-not-a-member-of-publishrequest-aws) – Ryan Wilson Sep 19 '22 at 15:08
  • `number` doesn't look like a valid E.164 phone number. Does your code work if you use a valid phone number? – Philip Pittle Oct 03 '22 at 22:46
  • Yes, the code is working fine. I just need to install the separate SDKs. previously I am using AWS SDK only – nawaz uddin Oct 04 '22 at 06:18

0 Answers0