Jump to content
php.lv forumi
Sign in to follow this  
emilsD

Csharp problema

Recommended Posts

2 hours ago, e-remit said:

Kāds ir kļūdas paziņojums? Googlē esi atļāvis savu kontu izmantot sūtīšanai?

Vispār jau, ja skatās Googles epasta instrukcijās, tur cits ports norādīts!

Errors https://prnt.sc/on3yta

Meginaju dazadus portus un gateway ka piemeram @sms.tele2.lv.

Un izmantoju savu acc gmail

Share this post


Link to post
Share on other sites

No sākuma tev jāpārliecinās, ka SMTP parametri ir pareizi. Paņem epasta klientu, kaut vai Mozilla Thunderbird un pamēģini caur šo SMTP serveri nosūtīt epastu! 

Share this post


Link to post
Share on other sites

PIereģistrējies mailgun, bezmaksās 2 tūkstoši epastu for free mēnesī

Share this post


Link to post
Share on other sites

Paldies.

Bet es nesaprotu ka seit pievienot telefona num:

Api kei ir,bet nesaprotu ar to numuru hmmm
 

using System;
using System.IO;
using RestSharp;
using RestSharp.Authenticators;

public class SendSimpleMessageChunk
{

    public static void Main (string[] args)
    {
        Console.WriteLine (SendSimpleMessage ().Content.ToString ());
    }

    public static IRestResponse SendSimpleMessage ()
    {
        RestClient client = new RestClient ();
        client.BaseUrl = new Uri ("https://api.mailgun.net/v3");
        client.Authenticator =
            new HttpBasicAuthenticator ("api",
                                        "YOUR_API_KEY");
        RestRequest request = new RestRequest ();
        request.AddParameter ("domain", "YOUR_DOMAIN_NAME", ParameterType.UrlSegment);
        request.Resource = "{domain}/messages";
        request.AddParameter ("from", "Excited User <mailgun@YOUR_DOMAIN_NAME>");
        request.AddParameter ("to", "bar@example.com");
        request.AddParameter ("to", "YOU@YOUR_DOMAIN_NAME");
        request.AddParameter ("subject", "Hello");
        request.AddParameter ("text", "Testing some Mailgun awesomness!");
        request.Method = Method.POST;
        return client.Execute (request);
    }

}

Iesledzot Tele2 Latvia 371#########@sms.tele2.lv send text 'ON' to 1612.

Un iesledzot gmail Atļauja piekļūt no lietotnēm ar zemāku drošības līmeni: IESLĒGTA  ,atnak sms no mana epasta.Bet man kautka gribetos,lai sutas vnk ka sms nevis no epasta,hmmmm

Vai ir jega no siem kadu nemt? Paskatijos nop... https://smsemailgateway.com/

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.Net.Mail;

namespace smssutit
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Button1_Click(object sender, EventArgs e)
        {
            MailMessage message = new MailMessage();
            message.To.Add("371xxxxxxxx@sms.tele2.lv");
            message.From = new MailAddress("tavsmails@gmail.com", "App");
            message.Body = "Jauna zina";
            SmtpClient smtp = new SmtpClient("smtp.gmail.com");
            smtp.EnableSsl = true;
            smtp.Port = 587;
            smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
            smtp.Credentials = new NetworkCredential("mailstavs@gmail.com", "parole");

            try
            {
                smtp.Send(message);

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}

Varbut ar kadu varam privati telegram? :)

Edited by emilsD

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...