Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Send sms to mobile phone using aws world wide sms - .Net Core console app

$
0
0

Greetings, I'm trying to use AWS world wide messaging service using C#/.Net Core.

However I do not receive the message in my phone number. Below is the code:

public static async Task<PublishResponse> sendSMS()
        {

            string accessKey = "my Key";
            string secretAccessKey = "my secret key";
            var client = new AmazonSimpleNotificationServiceClient(accessKey,
            secretAccessKey, RegionEndpoint.USEast1);

            string phoneNumber = "mynumber";

            PublishRequest req = new PublishRequest();
            req.Message = "Hellloooo from core";
            req.PhoneNumber = "+2" + phoneNumber;
            PublishResponse res = await client.PublishAsync(req);
            return res;
        }

And I invoke this method in the main function:

 public static void Main(string[] args)
        {
             var respond = sendSMS();
        }

I appreciate if anyone could help me with this. thanks in advance


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>