A Flutter Package to Verify Emails using OTP

Email verification for Flutter Apps using DART.

Key points :

  • This package allows developers to verify that the provided Email is valid and also an existing one,
  • It is confirmed by sending an OTP to the specified email ID and verify them.

Features!

Key changes:

  • No more static methods, All the methods are based on the class instance.
  • More reliable and understandable method names.
  • Change in parameters.
  • Session name is made mandatory.
  • Additional option to set the OTP length for production servers

Steps

Initialize the class

EmailAuth emailAuth =  new EmailAuth(sessionName: "Sample session");

Pass in the remote server config if present

emailAuth.config(remoteServerConfiguration);

// remoteServerConfiguration : Signature
{
  "server": "server url",
  "serverKey": "serverKey"
}

Sending an otp

  • Have the method wrapped in a async funtion.
void sendOtp() async {
  bool result = await emailAuth.sendOtp(
      recipientMail: _emailcontroller.value.text, otpLength: 5
      );
  }

Validating an otp

  • Have the method wrapped in a funtion for better reusablity.
emailAuth.validateOtp(
        recipientMail: _emailcontroller.value.text,
        userOtp: _otpcontroller.value.text)

Usage template example

import 'package:email_auth/email_auth.dart';
...
Inside your stateLess / Statefull widget class
  ...
  
  // Declare the object
  EmailAuth emailAuth;

  @override
  void initState() {
    super.initState();
    // Initialize the package
    emailAuth = new EmailAuth(
      sessionName: "Sample session",
    );

    /// Configuring the remote server
    emailAuth.config(remoteServerConfiguration);
  }

  final TextEditingController _emailController = TextEditingController();
  final TextEditingController _otpController = TextEditingController();

  /// a Boolean function to verify if the Data provided is true
  bool verify() {
    print(emailAuth.validateOtp(
        recipientMail: _emailcontroller.value.text,
        userOtp: _otpcontroller.value.text));
  }

  /// a void funtion to send the OTP to the user
  /// Can also be converted into a Boolean function and render accordingly for providers
  void sendOtp() async {
    bool result = await emailAuth.sendOtp(
        recipientMail: _emailcontroller.value.text, otpLength: 5);
    if (result) {
      // using a void function because i am using a 
      // stateful widget and seting the state from here.
      setState(() {
        submitValid = true;
      });
    }
  }
  
  ...
   Widget build(BuildContext context) {
   /// have your controllers assigned to textFields or textFormFields
   ...
    body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            TextField(
              controller: _emailController,
            ),
            TextField(
              controller: _otpController,
            ),
          ],
        ),
      ),
      ...

Reference

PropertyTypeDescription
EmailAuthClassThe parent Class
EmailAuth.sessionNameStringThe sessionName of the instance to be used
EmailAuth.configBoolean FunctionUsed to verify whether the remote server is valid
EmailAuth.sendOtpBoolean FunctionTakes care of sending OTP to the mail id provided
recipientMailparam of EmailAuth.sentOtp() methodemail ID of the recipient
otpLengthparam of EmailAuth.sentOtp() method : Defaults to 6length of the otp
EmailAuth.validateOtpBoolean FunctionTakes care of verifying the OTP entered by the user

Privacy Policy 😸

We never share the email ID's we get to any service, nor do we use them for our purposes, we regularly clean up the sent mail section, and we never save any data on our servers, we work on the main motive to be OPEN SOURCE , If so you have any queries kindly mail me at the email ID provided Always happy to answer.

⭐ If you like the package, a star to the repo will mean a lot.

Also feel free to fork the main branch and add some additional features, Will be eager to verify and add the updates.

Thankyou ❤️

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add email_auth

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  email_auth: ^1.0.0

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:email_auth/email_auth.dart'; 

example/lib/main.dart

import 'package:email_auth/email_auth.dart';
import 'package:flutter/material.dart';

/// Importing the configuration file to pass them to the EmailAuth instance
/// You can have a custom path and a variable name,
/// but the Map should be in the pattern {server : "", serverKey : ""}
import 'package:email_auth_example/auth.config.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  /// The boolean to handle the dynamic operations
  bool submitValid = false;

  /// Text editing controllers to get the value from text fields
  final TextEditingController _emailcontroller = TextEditingController();
  final TextEditingController _otpcontroller = TextEditingController();

  // Declare the object
  EmailAuth emailAuth;

  @override
  void initState() {
    super.initState();
    // Initialize the package
    emailAuth = new EmailAuth(
      sessionName: "Sample session",
    );

    /// Configuring the remote server
    emailAuth.config(remoteServerConfiguration);
  }

  /// a void function to verify if the Data provided is true
  /// Convert it into a boolean function to match your needs.
  void verify() {
    print(emailAuth.validateOtp(
        recipientMail: _emailcontroller.value.text,
        userOtp: _otpcontroller.value.text));
  }

  /// a void funtion to send the OTP to the user
  /// Can also be converted into a Boolean function and render accordingly for providers
  void sendOtp() async {
    bool result = await emailAuth.sendOtp(
        recipientMail: _emailcontroller.value.text, otpLength: 5);
    if (result) {
      setState(() {
        submitValid = true;
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Email Auth sample'),
        ),
        body: Container(
          margin: EdgeInsets.all(5),
          child: Center(
              child: Center(
            child: Column(
              children: <Widget>[
                TextField(
                  controller: _emailcontroller,
                ),
                Card(
                  margin: EdgeInsets.only(top: 20),
                  elevation: 6,
                  child: Container(
                    height: 50,
                    width: 200,
                    color: Colors.green[400],
                    child: GestureDetector(
                      onTap: sendOtp,
                      child: Center(
                        child: Text(
                          "Request OTP",
                          style: TextStyle(
                            fontWeight: FontWeight.bold,
                            color: Colors.white,
                            fontSize: 20,
                          ),
                        ),
                      ),
                    ),
                  ),
                ),

                /// A dynamically rendering text field
                (submitValid)
                    ? TextField(
                        controller: _otpcontroller,
                      )
                    : Container(height: 1),
                (submitValid)
                    ? Container(
                        margin: EdgeInsets.only(top: 20),
                        height: 50,
                        width: 200,
                        color: Colors.green[400],
                        child: GestureDetector(
                          onTap: verify,
                          child: Center(
                            child: Text(
                              "Verify",
                              style: TextStyle(
                                fontWeight: FontWeight.bold,
                                color: Colors.white,
                                fontSize: 20,
                              ),
                            ),
                          ),
                        ),
                      )
                    : SizedBox(height: 1)
              ],
            ),
          )),
        ),
      ),
    );
  }
} 

Download Details:

Author: saran-surya

Source Code: https://github.com/saran-surya/email_auth

#flutter #email #auth 

A Flutter Package to Verify Emails using OTP
Elian  Harber

Elian Harber

1658595480

Scrape: CLI Utility to Scrape Emails From Websites

Scrape

CLI utility to scrape emails from websites

Features

  • Asynchronous scraping
  • Recursive link follow
  • External link follow
  • Cloudflare email obfuscation decoding
  • Client side rendered pages support through headless chromium load awaits
  • Simple, grepable output

Install

MacOS:

brew tap lawzava/scrape https://github.com/lawzava/scrape
brew install scrape

Linux:

sudo snap install scrape

Usage

Sample call:

scrape -w https://lawzava.com

Depends on chromium or google-chrome being available in path if --js is used

Parameters:

      --async             Scrape website pages asynchronously (default true)
      --debug             Print debug logs
  -d, --depth int         Max depth to follow when scraping recursively (default 3)
      --follow-external   Follow external 3rd party links within website
  -h, --help              help for scrape
      --js                Enables EnableJavascript execution await
      --output string     Output type to use (default 'plain', supported: 'csv', 'json') (default "plain")
      --output-with-url   Adds URL to output with each email
      --recursively       Scrape website recursively (default true)
      --timeout int       If > 0, specify a timeout (seconds) for js execution await
  -w, --website string    Website to scrape (default "https://lawzava.com")

Note about scraper package

For those that are looking for scraper package - this repository was intended as a cli-use only thus the scraper package was moved to lawzava/emailscraper. The scrape utility will be maintained as a CLI implementation of emailscraper package.

Author: lawzava
Source Code: https://github.com/lawzava/scrape 
License: MIT license

#go #golang #email #cli 

Scrape: CLI Utility to Scrape Emails From Websites
Diego  Elizondo

Diego Elizondo

1658388600

Cómo Eliminar Correos Electrónicos Por Lotes En Gmail

Escucho a algunos de mis compañeros de trabajo hablar sobre llegar a la bandeja de entrada cero. Entonces comencé a pensar en una forma de borrar mis más de 4000 mensajes no leídos. Y después de días de buscar, encontré una manera.

Incluso eliminé 20.000 mensajes de correo electrónico de la papelera y ahorré un poco más de 1 gigabyte de espacio en disco en el proceso.
bandeja de entrada0

Hoy, quiero mostrarle cómo puede eliminar correos electrónicos por lotes en la aplicación Gmail, sin importar los miles de mensajes que tenga allí.

Cómo eliminar todos los correos electrónicos no leídos en Gmail

Paso 1 : Inicie sesión en su cuenta de Gmail

Paso 2 : En la barra de búsqueda, escribe in:unready presiona ENTER. Esto le mostrará 50 mensajes no leídos.
ss4-2

Paso 3 : seleccione la casilla de verificación en la esquina superior derecha para seleccionar 50 de los correos electrónicos no leídos.
ss5-2

Paso 4 : haga clic en el mensaje que dice "seleccione todas las conversaciones que coincidan con esta búsqueda". Esto seleccionará todos sus mensajes no leídos.
ss6-2

Paso 5 : haga clic en el icono de eliminar en la parte superior.
ss7-3

Paso 6 : aparecerá una ventana emergente que le preguntará si desea eliminar los mensajes de forma masiva. Haga clic en Aceptar".
ss8-2

Así es como puedes eliminar mensajes de forma masiva en Gmail.
ss9-2

Cómo borrar la papelera de Gmail

Paso 1 : Para borrar los mensajes de su Papelera, haga clic en "Más" a la izquierda y seleccione Papelera.
ss10-2

Paso 2 : haga clic en la casilla de verificación en la esquina superior derecha para seleccionar los mensajes en la papelera.
ss11-2

Paso 3 : Seleccione todos los mensajes en la Papelera y haga clic en "Eliminar para siempre".
ss12-2

Paso 4 : Haga clic en Aceptar para confirmar que desea eliminar todos los mensajes.
ss13-1

Debería recibir un mensaje de que x número de correos electrónicos se han eliminado para siempre. Si no recibe el mensaje aunque todo parezca claro, actualice la página.
ss14-1

También puede eliminar mensajes en la pestaña de promociones o redes sociales.

¿Cómo elimino correos electrónicos de la lista de promociones?

Para eliminar mensajes de correo electrónico en la pestaña de promoción, siga los pasos a continuación.

Paso 1 : Haga clic en Más a la derecha y seleccione Categorías.
ss15

Paso 2 : Haga clic en Promociones.
ss16

Paso 2 : haga clic en la casilla de verificación en la esquina superior derecha para seleccionar los 50 mensajes en la pestaña de promoción.
ss17

Paso 3 : Haga clic en seleccionar todas las conversaciones en la pestaña de promoción.
ss18

Paso 4 : haz clic en el icono de eliminar en la parte superior.
ss19

Paso 5 : Confirme que desea eliminar todos los mensajes en la pestaña de promoción.
ss20

Debería recibir un mensaje de que las conversaciones se han movido a la papelera.
ss21

Si desea eliminar mensajes en otras pestañas, como social o foro, repita el proceso que siguió para eliminar todos los mensajes en la pestaña de promoción.

Conclusión

Espero que este artículo lo ayude a eliminar los mensajes no deseados en su aplicación de Gmail para que también pueda llegar a la bandeja de entrada cero.

Hay otras formas de usar los operadores de búsqueda para consultar la aplicación de Gmail y revelar los mensajes recibidos a lo largo de los años para que pueda hacer lo que quiera con ellos. Puede encontrar esos operadores de búsqueda en el Soporte de Google.

Gracias por leer.

Fuente: https://www.freecodecamp.org/news/how-to-batch-delete-emails-in-gmail-delete-multiple-email-messages/

#email  #google 

Cómo Eliminar Correos Electrónicos Por Lotes En Gmail
Anne  de Morel

Anne de Morel

1658388540

Comment Supprimer Des E-mails Par Lots Dans Gmai

J'entends certains de mes collègues parler d'arriver à la boîte de réception zéro. J'ai donc commencé à réfléchir à un moyen d'effacer mes plus de 4000 messages non lus. Et après des jours de recherche, j'ai trouvé un moyen.

J'ai même continué à supprimer 20 000 e-mails de la corbeille - et économisé un peu plus de 1 gigaoctet d'espace disque dans le processus.
boîte de réception0

Aujourd'hui, je veux vous montrer comment vous pouvez supprimer des e-mails par lots dans l'application Gmail, quels que soient les milliers de messages que vous y avez.

Comment supprimer tous les e-mails non lus dans Gmail

Étape 1 : Connectez-vous à votre compte Gmail

Étape 2 : Dans la barre de recherche, tapez in:unreadet appuyez sur ENTER. Cela vous montrera 50 messages non lus.
SS4-2

Étape 3 : Cochez la case dans le coin supérieur droit pour sélectionner 50 des e-mails non lus.
SS5-2

Étape 4 : Cliquez sur le message qui dit "sélectionnez toutes les conversations qui correspondent à cette recherche". Cela sélectionnera tous vos messages non lus.
SS6-2

Étape 5 : Cliquez sur l'icône de suppression en haut.
SS7-3

Étape 6 : Une fenêtre contextuelle apparaîtra vous demandant si vous souhaitez supprimer les messages en masse. Cliquez sur OK".
SS8-2

C'est ainsi que vous pouvez supprimer des messages en bloc dans Gmail.
SS9-2

Comment effacer la corbeille Gmail

Étape 1 : Pour effacer les messages de votre corbeille, cliquez sur "Plus" à gauche et sélectionnez Corbeille.
SS10-2

Étape 2 : Cliquez sur la case à cocher dans le coin supérieur droit pour sélectionner les messages dans la corbeille.
SS11-2

Étape 3 : Sélectionnez tous les messages dans la corbeille et cliquez sur "Supprimer définitivement".
SS12-2

Étape 4 : Cliquez sur OK pour confirmer que vous souhaitez supprimer tous les messages.
SS13-1

Vous devriez recevoir un message indiquant que x nombre d'e-mails ont été supprimés pour toujours. Si vous ne recevez pas le message même si tout semble clair, actualisez la page.
SS14-1

Vous pouvez également supprimer des messages dans l'onglet promotion ou social.

Comment puis-je supprimer des e-mails de la liste de promotion ?

Pour supprimer des e-mails dans l'onglet Promotion, suivez les étapes ci-dessous.

Étape 1 : Cliquez sur Plus à droite et sélectionnez Catégories.
SS15

Étape 2 : Cliquez sur Promotions.
SS16

Étape 2 : Cliquez sur la case à cocher dans le coin supérieur droit pour sélectionner les 50 messages dans l'onglet Promotion.
SS17

Étape 3 : Cliquez sur sélectionner toutes les conversations dans l'onglet promotion.
SS18

Étape 4 : Cliquez sur l'icône de suppression en haut.
SS19

Étape 5 : Confirmez que vous souhaitez supprimer tous les messages dans l'onglet Promotion.
SS20

Vous devriez recevoir un message indiquant que les conversations ont été déplacées vers la corbeille.
SS21

Si vous souhaitez supprimer des messages dans d'autres onglets tels que social ou forum, répétez le processus que vous avez suivi pour supprimer tous les messages dans l'onglet de promotion.

Conclusion

J'espère que cet article vous aidera à supprimer les messages indésirables de votre application Gmail afin que vous puissiez également accéder à la boîte de réception zéro.

Il existe d'autres façons d'utiliser les opérateurs de recherche pour interroger l'application Gmail et révéler les messages reçus au fil des ans afin que vous puissiez en faire ce que vous voulez. Vous pouvez trouver ces opérateurs de recherche dans l'assistance Google.

Merci d'avoir lu.

Source : https://www.freecodecamp.org/news/how-to-batch-delete-emails-in-gmail-delete-multiple-email-messages/

#email  #google 

Comment Supprimer Des E-mails Par Lots Dans Gmai
藤本  結衣

藤本 結衣

1658385120

Gmailでメールをバッチ削除する

同僚の何人かが受信トレイをゼロにすることについて話しているのを聞いています。そこで、4000を超える未読メッセージを消去する方法を考え始めました。そして、何日も探し回った後、私は方法を見つけました。

さらに、ゴミ箱から20,000通の電子メールメッセージを削除し、その過程で1ギガバイトをわずかに超えるディスク容量を節約しました。
inbox0

今日は、Gmailアプリで何千ものメッセージがあったとしても、メールを一括削除する方法を紹介したいと思います。

Gmailで未読メールをすべて削除する方法

ステップ1:Gmailアカウントにログインします

ステップ2:検索バーに「。」と入力in:unreadして押しENTERます。これにより、50件の未読メッセージが表示されます。
ss4-2

ステップ3:右上隅のチェックボックスを選択して、未読メールを50通選択します。
ss5-2

ステップ4:「この検索に一致するすべての会話を選択してください」というメッセージをクリックします。これにより、未読メッセージがすべて選択されます。
ss6-2

ステップ5:上部の削除アイコンをクリックします。
ss7-3

ステップ6:メッセージを一括削除するかどうかを尋ねるポップアップが表示されます。「OK」をクリックします。
ss8-2

これが、Gmailでメッセージを一括削除する方法です。
ss9-2

Gmailのゴミ箱をクリアする方法

ステップ1:ゴミ箱からメッセージをクリアするには、左側の[その他]をクリックして[ゴミ箱]を選択します。
ss10-2

ステップ2:右上隅のチェックボックスをクリックして、ゴミ箱にあるメッセージを選択します。
ss11-2

ステップ3:ゴミ箱にあるすべてのメッセージを選択し、[完全に削除]をクリックします。
ss12-2

手順4:[OK]をクリックして、すべてのメッセージを削除することを確認します。
ss13-1

x個のメールが完全に削除されたというメッセージが表示されます。すべてがクリアに表示されてもメッセージが表示されない場合は、ページを更新してください。
ss14-1

[プロモーション]タブまたは[ソーシャル]タブでメッセージを削除することもできます。

プロモーションリストからメールを削除するにはどうすればよいですか?

[プロモーション]タブでメールメッセージを削除するには、次の手順に従います。

ステップ1:右側の[その他]をクリックして、[カテゴリ]を選択します。
ss15

ステップ2:[プロモーション]をクリックします。
ss16

ステップ2:右上隅のチェックボックスをクリックして、[プロモーション]タブで50件のメッセージをすべて選択します。
ss17

ステップ3:[プロモーション]タブで[すべての会話を選択]をクリックします。
ss18

ステップ4:上部の削除アイコンをクリックします。
ss19

手順5:[プロモーション]タブですべてのメッセージを削除することを確認します。
ss20

会話がゴミ箱に移動されたというメッセージが表示されます。
ss21

ソーシャルやフォーラムなどの他のタブのメッセージを削除する場合は、実行したプロセスを繰り返して、[プロモーション]タブのすべてのメッセージを削除します。

結論

この記事がGmailアプリの不要なメッセージを削除して、受信トレイをゼロにするのに役立つことを願っています。

検索演算子を使用してGmailアプリにクエリを実行し、何年にもわたって受信したメッセージを表示して、好きなことを実行できるようにする方法は他にもあります。これらの検索演算子は、Googleサポートで見つけることができます。

読んでくれてありがとう。

ソース:https ://www.freecodecamp.org/news/how-to-batch-delete-emails-in-gmail-delete-multiple-email-messages/

#email  #google 

Gmailでメールをバッチ削除する
Duong Tran

Duong Tran

1658384700

Cách Xóa Hàng Loạt Email Trong Gmail

Tôi nghe một số đồng nghiệp của tôi nói về việc không nhận được hộp thư đến. Vì vậy, tôi bắt đầu nghĩ cách xóa hơn 4000 tin nhắn chưa đọc của mình. Và sau nhiều ngày tìm kiếm khắp nơi, tôi đã tìm ra cách.

Tôi thậm chí đã tiếp tục xóa 20.000 email khỏi thùng rác - và chỉ tiết kiệm được hơn 1 gigabyte dung lượng đĩa trong quá trình này.
hộp thư đến0

Hôm nay, tôi muốn chỉ cho bạn cách bạn có thể xóa hàng loạt email trong ứng dụng Gmail - bất kể bạn có hàng nghìn thư ở đó.

Cách xóa tất cả email chưa đọc trong Gmail

Bước 1 : Đăng nhập vào tài khoản Gmail của bạn

Bước 2 : Trên thanh tìm kiếm, nhập in:unreadvà nhấn ENTER. Điều này sẽ hiển thị cho bạn 50 tin nhắn chưa đọc.
ss4-2

Bước 3 : Chọn hộp kiểm ở góc trên bên phải để chọn 50 email chưa đọc.
ss5-2

Bước 4 : Nhấp vào thông báo có nội dung “chọn tất cả các cuộc trò chuyện phù hợp với tìm kiếm này”. Thao tác này sẽ chọn tất cả các tin nhắn chưa đọc của bạn.
ss6-2

Bước 5 : Nhấp vào biểu tượng xóa ở trên cùng.
ss7-3

Bước 6 : Một cửa sổ bật lên sẽ xuất hiện hỏi bạn có muốn xóa hàng loạt tin nhắn hay không. Nhấp vào “Ok”.
ss8-2

Đó là cách bạn có thể xóa hàng loạt thư trong Gmail.
ss9-2

Cách xóa thùng rác Gmail

Bước 1 : Để xóa thư khỏi Thùng rác, hãy nhấp vào “Thêm” ở bên trái và chọn Thùng rác.
ss10-2

Bước 2 : Nhấp vào hộp kiểm ở góc trên bên phải để chọn thư vào thùng rác.
ss11-2

Bước 3 : Chọn tất cả thư trong Thùng rác và nhấp vào “Xóa vĩnh viễn”.
ss12-2

Bước 4 : Nhấn Ok để xác nhận rằng bạn muốn xóa tất cả các tin nhắn.
ss13-1

Bạn sẽ nhận được một thông báo rằng x số email đã bị xóa vĩnh viễn. Nếu bạn không nhận được thông báo ngay cả khi mọi thứ hiển thị rõ ràng, hãy làm mới trang.
ss14-1

Bạn cũng có thể xóa tin nhắn trong tab quảng cáo hoặc xã hội.

Làm cách nào để Xóa Email khỏi Danh sách Khuyến mại?

Để xóa tin nhắn email trong tab quảng cáo, hãy làm theo các bước bên dưới.

Bước 1 : Nhấp vào Thêm ở bên phải và chọn Danh mục.
ss15

Bước 2 : Nhấp vào Khuyến mãi.
ss16

Bước 2 : Nhấp vào hộp kiểm ở góc trên bên phải để chọn tất cả 50 tin nhắn trong tab khuyến mãi.
ss17

Bước 3 : Bấm chọn tất cả các cuộc hội thoại trong tab khuyến mãi.
ss18

Bước 4 : Nhấp vào biểu tượng xóa ở trên cùng.
ss19

Bước 5 : Xác nhận bạn muốn xóa tất cả tin nhắn trong tab khuyến mãi.
ss20

Bạn sẽ nhận được thông báo rằng các cuộc trò chuyện đã được chuyển vào thùng rác.
ss21

Nếu bạn muốn xóa tin nhắn trong các tab khác, chẳng hạn như xã hội hoặc diễn đàn, hãy lặp lại quy trình bạn đã trải qua để xóa tất cả tin nhắn trong tab quảng cáo.

Sự kết luận

Tôi hy vọng bài viết này sẽ giúp bạn xóa các thư không mong muốn trong ứng dụng Gmail của mình để bạn cũng có thể chuyển đến hộp thư đến bằng không.

Có những cách khác bạn có thể sử dụng toán tử tìm kiếm để truy vấn ứng dụng Gmail và hiển thị các thư đã nhận trong nhiều năm để bạn có thể làm những gì bạn muốn với chúng. Bạn có thể tìm thấy các toán tử tìm kiếm đó trong Bộ phận hỗ trợ của Google.

Cảm ơn vì đã đọc.

Nguồn: https://www.freecodecamp.org/news/how-to-batch-delete-emails-in-gmail-delete-multiple-email-messages/

#email  #google 

Cách Xóa Hàng Loạt Email Trong Gmail
Mélanie  Faria

Mélanie Faria

1658381340

Como Excluir E-mails Em Lote No Gmai

Eu ouço alguns dos meus colegas de trabalho falarem sobre como chegar à caixa de entrada zero. Então comecei a pensar em uma maneira de limpar minhas mais de 4.000 mensagens não lidas. E depois de dias procurando por aí, encontrei um jeito.

Eu até deletei 20.000 mensagens de e-mail da lixeira – e economizei pouco mais de 1 gigabyte de espaço em disco no processo.
caixa de entrada0

Hoje, quero mostrar como você pode excluir e-mails em lote no aplicativo Gmail - não importa as milhares de mensagens que você tenha lá.

Como excluir todos os e-mails não lidos no Gmail

Etapa 1 : faça login na sua conta do Gmail

Passo 2 : Na barra de pesquisa, digite in:unreade pressione ENTER. Isso mostrará 50 mensagens não lidas.
ss4-2

Etapa 3 : marque a caixa de seleção no canto superior direito para selecionar 50 dos e-mails não lidos.
ss5-2

Passo 4 : Clique na mensagem que diz “selecione todas as conversas que correspondem a esta pesquisa”. Isso selecionará todas as suas mensagens não lidas.
ss6-2

Passo 5 : Clique no ícone de exclusão na parte superior.
ss7-3

Passo 6 : Um pop-up aparecerá perguntando se você deseja excluir as mensagens em massa. Clique OK".
ss8-2

É assim que você pode excluir mensagens em massa no Gmail.
ss9-2

Como limpar a lixeira do Gmail

Passo 1 : Para limpar as mensagens da sua Lixeira, clique em “Mais” à esquerda e selecione Lixeira.
ss10-2

Etapa 2 : Clique na caixa de seleção no canto superior direito para selecionar as mensagens na lixeira.
ss11-2

Passo 3 : Selecione todas as mensagens na Lixeira e clique em “Excluir para sempre”.
ss12-2

Etapa 4 : Clique em Ok para confirmar que deseja excluir todas as mensagens.
ss13-1

Você deve receber uma mensagem de que x número de e-mails foram excluídos para sempre. Se você não receber a mensagem mesmo que tudo pareça claro, atualize a página.
ss14-1

Você também pode excluir mensagens na aba promoção ou social.

Como faço para excluir e-mails da lista de promoções?

Para excluir mensagens de e-mail na guia de promoção, siga as etapas abaixo.

Etapa 1 : Clique em Mais à direita e selecione Categorias.
ss15

Passo 2 : Clique em Promoções.
ss16

Etapa 2 : Clique na caixa de seleção no canto superior direito para selecionar todas as 50 mensagens na guia de promoção.
ss17

Etapa 3 : clique em selecionar todas as conversas na guia promoção.
ss18

Passo 4 : Clique no ícone de exclusão na parte superior.
ss19

Etapa 5 : confirme que deseja excluir todas as mensagens na guia de promoção.
ss20

Você deve receber uma mensagem informando que as conversas foram movidas para a lixeira.
ss21

Se você deseja excluir mensagens em outras guias, como social ou fórum, repita o processo pelo qual você passou para excluir todas as mensagens na guia promoção.

Conclusão

Espero que este artigo ajude você a excluir as mensagens indesejadas em seu aplicativo Gmail para que você também possa chegar à caixa de entrada zero.

Existem outras maneiras de usar os operadores de pesquisa para consultar o aplicativo Gmail e revelar as mensagens recebidas ao longo dos anos para que você possa fazer o que quiser com elas. Você pode encontrar esses operadores de pesquisa no Suporte do Google.

Obrigado por ler.

Fonte: https://www.freecodecamp.org/news/how-to-batch-delete-emails-in-gmail-delete-multiple-email-messages/

#email  #google 

Como Excluir E-mails Em Lote No Gmai
郝 玉华

郝 玉华

1658380740

如何在 Gmai 中批量删除电子邮件

我听到我的一些同事谈论要达到收件箱零。所以我开始想办法清除我超过 4000 条未读消息。经过几天的搜索,我找到了一种方法。

我什至继续从垃圾箱中删除了 20,000 封电子邮件,并在此过程中节省了超过 1 GB 的磁盘空间。
收件箱0

今天,我想向您展示如何在 Gmail 应用程序中批量删除电子邮件——无论您有成千上万的邮件。

如何删除 Gmail 中的所有未读邮件

第 1 步:登录到您的 Gmail 帐户

第 2 步:在搜索栏中,键入in:unread并点击ENTER。这将显示 50 条未读消息。
ss4-2

第 3 步:选中右上角的复选框以选择 50 封未读电子邮件。
SS5-2

第 4 步:单击“选择与此搜索匹配的所有对话”的消息。这将选择所有未读邮件。
ss6-2

第 5 步:单击顶部的删除图标。
ss7-3

第 6 步:将出现一个弹出窗口,询问您是否要批量删除消息。单击“确定”。
SS8-2

这就是您可以在 Gmail 中批量删除邮件的方式。
SS9-2

如何清除 Gmail 垃圾箱

第 1 步:要清除垃圾箱中的邮件,请单击左侧的“更多”并选择垃圾箱。
SS10-2

第 2 步:单击右上角的复选框以选择垃圾箱中的邮件。
SS11-2

第 3 步:选择垃圾箱中的所有邮件,然后单击“永久删除”。
SS12-2

第 4 步:单击确定以确认您要删除所有消息。
SS13-1

您应该会收到一条消息,指出 x 封电子邮件已被永久删除。如果即使一切都清楚,您也没有收到消息,请刷新页面。
ss14-1

您还可以删除促销或社交选项卡中的消息。

如何从促销列表中删除电子邮件?

要删除促销选项卡中的电子邮件,请按照以下步骤操作。

第 1 步:点击右侧的更多,然后选择类别。
ss15

第 2 步:点击促销。
ss16

第 2 步:单击右上角的复选框以选择促销选项卡中的所有 50 条消息。
ss17

第 3 步:单击促销选项卡中的选择所有对话。
SS18

第 4 步:单击顶部的删除图标。
ss19

第 5 步:确认您要删除促销选项卡中的所有消息。
SS20

您应该会收到一条消息,表明对话已被移至垃圾箱。
SS21

如果您想删除其他选项卡(例如社交或论坛)中的消息,请重复您执行的过程以删除促销选项卡中的所有消息。

结论

我希望这篇文章可以帮助您删除 Gmail 应用中不需要的邮件,这样您也可以将收件箱归零。

您还可以通过其他方式使用搜索运算符来查询 Gmail 应用程序并显示多年来收到的邮件,以便您可以随心所欲地使用它们。您可以在 Google 支持中找到这些搜索运算符。

谢谢阅读。

来源:https ://www.freecodecamp.org/news/how-to-batch-delete-emails-in-gmail-delete-multiple-email-messages/

#email  #google 

如何在 Gmai 中批量删除电子邮件

How to Batch Delete Emails in Gmai

I hear some of my co-workers talk about getting to inbox zero. So I started thinking of a way to clear out my over over 4000 unread messages. And after days of searching around, I found a way.

I even went on to delete 20,000 email messages from the trash – and saved just over 1 gigabyte of disk space in the process.
inbox0

Today, I want to show you how you can batch delete emails in the Gmail app – no matter the thousands of messages you have there.

How to Delete All Unread Emails in Gmail

Step 1: Log in to your Gmail account

Step 2: In the search bar, type in:unread and hit ENTER. This will show you 50 unread messages.
ss4-2

Step 3: Select the checkbox in the top-right corner to select 50 of the unread emails.
ss5-2

Step 4: Click the message that says “select all conversations that match this search”. This will select all your unread messages.
ss6-2

Step 5: Click the delete icon at the top.
ss7-3

Step 6: A pop up will appear asking if you want to bulk delete the messages. Click “Ok”.
ss8-2

That’s how you can bulk delete messages in Gmail.
ss9-2

How to Clear Gmail Trash

Step 1: To clear the messages from your Trash, click “More” on the left and select Trash.
ss10-2

Step 2: Click the checkbox in the top-right corner to select the messages in the trash.
ss11-2

Step 3: Select all the messages in Trash and click “Delete forever”.
ss12-2

Step 4: Click Ok to confirm that you want to delete all the messages.
ss13-1

You should get a message that x number of emails have been deleted forever. If you don’t get the message even if everything appears clear, refresh the page.
ss14-1

You can also delete messages in the promotion or social tab.

How do I Delete Emails from the Promotion List?

To delete email messages in the promotion tab, follow the steps below.

Step 1: Click More on the right and select Categories.
ss15

Step 2: Click Promotions.
ss16

Step 2: Click the checkbox on the top-right corner to select all 50 messages in the promotion tab.
ss17

Step 3: Click select all conversations in the promotion tab.
ss18

Step 4: Click the delete icon at the top.
ss19

Step 5: Confirm you want to delete all messages in the promotion tab.
ss20

You should get a message that the conversations have been moved to trash.
ss21

If you want to delete messages in other tabs such as social, or forum, repeat the process you went through to delete all messages in the promotion tab.

Conclusion

I hope this article helps you delete the unwanted messages in your Gmail app so you can also get to inbox zero.

There are other ways you can use search operators to query the Gmail app and reveal messages received over the years so you can do what you want with them. You can find those search operators in Google Support.

Thanks for reading.

Source: https://www.freecodecamp.org/news/how-to-batch-delete-emails-in-gmail-delete-multiple-email-messages/

#email #google 

How to Batch Delete Emails in Gmai
Rupert  Beatty

Rupert Beatty

1658328360

Laravel-mailbox: Catch incoming Emails In Your Laravel Application

Laravel Mailbox 📬   

Handle incoming emails in your Laravel application.

Mailbox::from('{username}@gmail.com', function (InboundEmail $email, $username) {
    // Access email attributes and content
    $subject = $email->subject();
    
    $email->reply(new ReplyMailable);
});

https://phppackagedevelopment.com

If you want to learn how to create reusable PHP packages yourself, take a look at my upcoming PHP Package Development video course.

Installation

You can install the package via composer:

composer require beyondcode/laravel-mailbox

Usage

Take a look at the official documentation.

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email marcel@beyondco.de instead of using the issue tracker.

Credits

Author: Beyondcode
Source Code: https://github.com/beyondcode/laravel-mailbox 
License: MIT license

#laravel #php #email 

Laravel-mailbox: Catch incoming Emails In Your Laravel Application
Royce  Reinger

Royce Reinger

1658286060

Mail: A Really Ruby Mail Library

Mail

Introduction

Mail is an internet library for Ruby that is designed to handle email generation, parsing and sending in a simple, rubyesque manner.

The purpose of this library is to provide a single point of access to handle all email functions, including sending and receiving email. All network type actions are done through proxy methods to Net::SMTP, Net::POP3 etc.

Built from my experience with TMail, it is designed to be a pure ruby implementation that makes generating, sending and parsing email a no brainer.

It is also designed from the ground up to work with the more modern versions of Ruby. Modern Rubies handle text encodings much more wonderfully than before so these features have been taken full advantage of in this library allowing Mail to handle a lot more messages more cleanly than TMail.

Finally, Mail has been designed with a very simple object oriented system that really opens up the email messages you are parsing, if you know what you are doing, you can fiddle with every last bit of your email directly.

You can contribute to this library

Yes, you! Mail is used in countless apps by people around the world. It is, like all open source software, a labour of love borne from our free time. If you would like to say thanks, please dig in and contribute alongside us! Triage and fix GitHub issues, improve our documentation, add new features—up to you! Thank you for pitching in.

Compatibility

Mail supports Ruby 2.5+, including JRuby and TruffleRuby.

As new versions of Ruby are released, Mail will be compatible with support for the "preview" and all "normal maintenance", "security maintenance" and the two most recent "end of life" versions listed at the Ruby Maintenance Branches page. Pull requests to assist in adding support for new preview releases are more than welcome.

Every Mail commit is tested by GitHub Actions on all supported Ruby versions.

Discussion

If you want to discuss mail with like minded individuals, please subscribe to the Google Group.

Current Capabilities of Mail

  • RFC5322 Support, Reading and Writing
  • RFC6532 Support, reading UTF-8 headers
  • RFC2045-2049 Support for multipart email
  • Support for creating multipart alternate email
  • Support for reading multipart/report email & getting details from such
  • Wrappers for File, Net/POP3, Net/SMTP
  • Auto-encoding of non-US-ASCII bodies and header fields

Mail is RFC5322 and RFC6532 compliant now, that is, it can parse US-ASCII and UTF-8 email and generate US-ASCII email. There are a few obsoleted email syntax that it will have problems with, but it also is quite robust, meaning, if it finds something it doesn't understand it will not crash, instead, it will skip the problem and keep parsing. In the case of a header it doesn't understand, it will initialise the header as an optional unstructured field and continue parsing.

This means Mail won't (ever) crunch your data (I think).

You can also create MIME emails. There are helper methods for making a multipart/alternate email for text/plain and text/html (the most common pair) and you can manually create any other type of MIME email.

Roadmap

Next TODO:

  • Improve MIME support for character sets in headers, currently works, mostly, needs refinement.

Testing Policy

Basically... we do BDD on Mail. No method gets written in Mail without a corresponding or covering spec. We expect as a minimum 100% coverage measured by RCov. While this is not perfect by any measure, it is pretty good. Additionally, all functional tests from TMail are to be passing before the gem gets released.

It also means you can be sure Mail will behave correctly.

You can run tests locally by running bundle exec rspec.

You can run tests on all supported Ruby versions by using act.

API Policy

No API removals within a single point release. All removals to be deprecated with warnings for at least one MINOR point release before removal.

Also, all private or protected methods to be declared as such - though this is still I/P.

Installation

Installation is fairly simple, I host mail on rubygems, so you can just do:

# gem install mail

Encodings

If you didn't know, handling encodings in Emails is not as straight forward as you would hope.

I have tried to simplify it some:

All objects that can render into an email, have an #encoded method. Encoded will return the object as a complete string ready to send in the mail system, that is, it will include the header field and value and CRLF at the end and wrapped as needed.

All objects that can render into an email, have a #decoded method. Decoded will return the object's "value" only as a string. This means it will not include the header fields (like 'To:' or 'Subject:').

By default, calling #to_s on a container object will call its encoded method, while #to_s on a field object will call its decoded method. So calling #to_s on a Mail object will return the mail, all encoded ready to send, while calling #to_s on the From field or the body will return the decoded value of the object. The header object of Mail is considered a container. If you are in doubt, call #encoded, or #decoded explicitly, this is safer if you are not sure.

Structured fields that have parameter values that can be encoded (e.g. Content-Type) will provide decoded parameter values when you call the parameter names as methods against the object.

Structured fields that have parameter values that can be encoded (e.g. Content-Type) will provide encoded parameter values when you call the parameter names through the object.parameters[''] method call.

Contributing

Please do! Contributing is easy in Mail. Please read the CONTRIBUTING.md document for more info.

Usage

All major mail functions should be able to happen from the Mail module. So, you should be able to just require 'mail' to get started.

mail is pretty well documented in its Ruby code. You can look it up e.g. at rubydoc.info.

Making an email

mail = Mail.new do
  from    'mikel@test.lindsaar.net'
  to      'you@test.lindsaar.net'
  subject 'This is a test email'
  body    File.read('body.txt')
end

mail.to_s #=> "From: mikel@test.lindsaar.net\r\nTo: you@...

Making an email, have it your way:

mail = Mail.new do
  body File.read('body.txt')
end

mail['from'] = 'mikel@test.lindsaar.net'
mail[:to]    = 'you@test.lindsaar.net'
mail.subject = 'This is a test email'

mail.header['X-Custom-Header'] = 'custom value'

mail.to_s #=> "From: mikel@test.lindsaar.net\r\nTo: you@...

Don't Worry About Message IDs:

mail = Mail.new do
  to   'you@test.lindsaar.net'
  body 'Some simple body'
end

mail.to_s =~ /Message\-ID: <[\d\w_]+@.+.mail/ #=> 27

Mail will automatically add a Message-ID field if it is missing and give it a unique, random Message-ID along the lines of:

<4a7ff76d7016_13a81ab802e1@local.host.mail>

Or do worry about Message-IDs:

mail = Mail.new do
  to         'you@test.lindsaar.net'
  message_id '<ThisIsMyMessageId@some.domain.com>'
  body       'Some simple body'
end

mail.to_s =~ /Message\-ID: <ThisIsMyMessageId@some.domain.com>/ #=> 27

Mail will take the message_id you assign to it trusting that you know what you are doing.

Sending an email:

Mail defaults to sending via SMTP to local host port 25. If you have a sendmail or postfix daemon running on this port, sending email is as easy as:

Mail.deliver do
  from     'me@test.lindsaar.net'
  to       'you@test.lindsaar.net'
  subject  'Here is the image you wanted'
  body     File.read('body.txt')
  add_file '/full/path/to/somefile.png'
end

or

mail = Mail.new do
  from     'me@test.lindsaar.net'
  to       'you@test.lindsaar.net'
  subject  'Here is the image you wanted'
  body     File.read('body.txt')
  add_file :filename => 'somefile.png', :content => File.read('/somefile.png')
end

mail.deliver!

Sending via sendmail can be done like so:

mail = Mail.new do
  from     'me@test.lindsaar.net'
  to       'you@test.lindsaar.net'
  subject  'Here is the image you wanted'
  body     File.read('body.txt')
  add_file :filename => 'somefile.png', :content => File.read('/somefile.png')
end

mail.delivery_method :sendmail

mail.deliver

Sending via smtp (for example to mailcatcher)


Mail.defaults do
  delivery_method :smtp, address: "localhost", port: 1025
end

Exim requires its own delivery manager, and can be used like so:

mail.delivery_method :exim, :location => "/usr/bin/exim"

mail.deliver

Mail may be "delivered" to a logfile, too, for development and testing:

# Delivers by logging the encoded message to $stdout
mail.delivery_method :logger

# Delivers to an existing logger at :debug severity
mail.delivery_method :logger, logger: other_logger, severity: :debug

Getting Emails from a POP or IMAP Server:

You can configure Mail to receive email using retriever_method within Mail.defaults:

# e.g. POP3
Mail.defaults do
  retriever_method :pop3, :address    => "pop.gmail.com",
                          :port       => 995,
                          :user_name  => '<username>',
                          :password   => '<password>',
                          :enable_ssl => true
end

# IMAP
Mail.defaults do
  retriever_method :imap, :address    => "imap.mailbox.org",
                          :port       => 993,
                          :user_name  => '<username>',
                          :password   => '<password>',
                          :enable_ssl => true
end

You can access incoming email in a number of ways.

The most recent email:

Mail.all    #=> Returns an array of all emails
Mail.first  #=> Returns the first unread email
Mail.last   #=> Returns the last unread email

The first 10 emails sorted by date in ascending order:

emails = Mail.find(:what => :first, :count => 10, :order => :asc)
emails.length #=> 10

Or even all emails:

emails = Mail.all
emails.length #=> LOTS!

Reading an Email

mail = Mail.read('/path/to/message.eml')

mail.envelope_from   #=> 'mikel@test.lindsaar.net'
mail.from.addresses  #=> ['mikel@test.lindsaar.net', 'ada@test.lindsaar.net']
mail.sender.address  #=> 'mikel@test.lindsaar.net'
mail.to              #=> 'bob@test.lindsaar.net'
mail.cc              #=> 'sam@test.lindsaar.net'
mail.subject         #=> "This is the subject"
mail.date.to_s       #=> '21 Nov 1997 09:55:06 -0600'
mail.message_id      #=> '<4D6AA7EB.6490534@xxx.xxx>'
mail.decoded         #=> 'This is the body of the email...

Many more methods available.

Reading a Multipart Email

mail = Mail.read('multipart_email')

mail.multipart?          #=> true
mail.parts.length        #=> 2
mail.body.preamble       #=> "Text before the first part"
mail.body.epilogue       #=> "Text after the last part"
mail.parts.map { |p| p.content_type }  #=> ['text/plain', 'application/pdf']
mail.parts.map { |p| p.class }         #=> [Mail::Message, Mail::Message]
mail.parts[0].content_type_parameters  #=> {'charset' => 'ISO-8859-1'}
mail.parts[1].content_type_parameters  #=> {'name' => 'my.pdf'}

Mail generates a tree of parts. Each message has many or no parts. Each part is another message which can have many or no parts.

A message will only have parts if it is a multipart/mixed or multipart/related content type and has a boundary defined.

Testing and Extracting Attachments

mail.attachments.each do | attachment |
  # Attachments is an AttachmentsList object containing a
  # number of Part objects
  if (attachment.content_type.start_with?('image/'))
    # extracting images for example...
    filename = attachment.filename
    begin
      File.open(images_dir + filename, "w+b", 0644) {|f| f.write attachment.decoded}
    rescue => e
      puts "Unable to save data for #{filename} because #{e.message}"
    end
  end
end

Writing and Sending a Multipart/Alternative (HTML and Text) Email

Mail makes some basic assumptions and makes doing the common thing as simple as possible.... (asking a lot from a mail library)

mail = Mail.deliver do
  to      'nicolas@test.lindsaar.net.au'
  from    'Mikel Lindsaar <mikel@test.lindsaar.net.au>'
  subject 'First multipart email sent with Mail'

  text_part do
    body 'This is plain text'
  end

  html_part do
    content_type 'text/html; charset=UTF-8'
    body '<h1>This is HTML</h1>'
  end
end

Mail then delivers the email at the end of the block and returns the resulting Mail::Message object, which you can then inspect if you so desire...

puts mail.to_s #=>

To: nicolas@test.lindsaar.net.au
From: Mikel Lindsaar <mikel@test.lindsaar.net.au>
Subject: First multipart email sent with Mail
Content-Type: multipart/alternative;
  boundary=--==_mimepart_4a914f0c911be_6f0f1ab8026659
Message-ID: <4a914f12ac7e_6f0f1ab80267d1@baci.local.mail>
Date: Mon, 24 Aug 2009 00:15:46 +1000
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit


----==_mimepart_4a914f0c911be_6f0f1ab8026659
Content-ID: <4a914f12c8c4_6f0f1ab80268d6@baci.local.mail>
Date: Mon, 24 Aug 2009 00:15:46 +1000
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

This is plain text
----==_mimepart_4a914f0c911be_6f0f1ab8026659
Content-Type: text/html; charset=UTF-8
Content-ID: <4a914f12cf86_6f0f1ab802692c@baci.local.mail>
Date: Mon, 24 Aug 2009 00:15:46 +1000
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit

<h1>This is HTML</h1>
----==_mimepart_4a914f0c911be_6f0f1ab8026659--

Mail inserts the content transfer encoding, the mime version, the content-IDs and handles the content-type and boundary.

Mail assumes that if your text in the body is only us-ascii, that your transfer encoding is 7bit and it is text/plain. You can override this by explicitly declaring it.

Making Multipart/Alternate, Without a Block

You don't have to use a block with the text and html part included, you can just do it declaratively. However, you need to add Mail::Parts to an email, not Mail::Messages.

mail = Mail.new do
  to      'nicolas@test.lindsaar.net.au'
  from    'Mikel Lindsaar <mikel@test.lindsaar.net.au>'
  subject 'First multipart email sent with Mail'
end

text_part = Mail::Part.new do
  body 'This is plain text'
end

html_part = Mail::Part.new do
  content_type 'text/html; charset=UTF-8'
  body '<h1>This is HTML</h1>'
end

mail.text_part = text_part
mail.html_part = html_part

Results in the same email as done using the block form

Getting Error Reports from an Email:

@mail = Mail.read('/path/to/bounce_message.eml')

@mail.bounced?         #=> true
@mail.final_recipient  #=> rfc822;mikel@dont.exist.com
@mail.action           #=> failed
@mail.error_status     #=> 5.5.0
@mail.diagnostic_code  #=> smtp;550 Requested action not taken: mailbox unavailable
@mail.retryable?       #=> false

Attaching and Detaching Files

You can just read the file off an absolute path, Mail will try to guess the mime_type and will encode the file in Base64 for you.

@mail = Mail.new
@mail.add_file("/path/to/file.jpg")
@mail.parts.first.attachment? #=> true
@mail.parts.first.content_transfer_encoding.to_s #=> 'base64'
@mail.attachments.first.mime_type #=> 'image/jpg'
@mail.attachments.first.filename #=> 'file.jpg'
@mail.attachments.first.decoded == File.read('/path/to/file.jpg') #=> true

Or You can pass in file_data and give it a filename, again, mail will try and guess the mime_type for you.

@mail = Mail.new
@mail.attachments['myfile.pdf'] = File.read('path/to/myfile.pdf')
@mail.parts.first.attachment? #=> true
@mail.attachments.first.mime_type #=> 'application/pdf'
@mail.attachments.first.decoded == File.read('path/to/myfile.pdf') #=> true

You can also override the guessed MIME media type if you really know better than mail (this should be rarely needed)

@mail = Mail.new
@mail.attachments['myfile.pdf'] = { :mime_type => 'application/x-pdf',
                                    :content => File.read('path/to/myfile.pdf') }
@mail.parts.first.mime_type #=> 'application/x-pdf'

Of course... Mail will round trip an attachment as well

@mail = Mail.new do
  to      'nicolas@test.lindsaar.net.au'
  from    'Mikel Lindsaar <mikel@test.lindsaar.net.au>'
  subject 'First multipart email sent with Mail'

  text_part do
    body 'Here is the attachment you wanted'
  end

  html_part do
    content_type 'text/html; charset=UTF-8'
    body '<h1>Funky Title</h1><p>Here is the attachment you wanted</p>'
  end

  add_file '/path/to/myfile.pdf'
end

@round_tripped_mail = Mail.new(@mail.encoded)

@round_tripped_mail.attachments.length #=> 1
@round_tripped_mail.attachments.first.filename #=> 'myfile.pdf'

See "Testing and extracting attachments" above for more details.

Using Mail with Testing or Spec'ing Libraries

If mail is part of your system, you'll need a way to test it without actually sending emails, the TestMailer can do this for you.

require 'mail'
=> true
Mail.defaults do
  delivery_method :test
end
=> #<Mail::Configuration:0x19345a8 @delivery_method=Mail::TestMailer>
Mail::TestMailer.deliveries
=> []
Mail.deliver do
  to 'mikel@me.com'
  from 'you@you.com'
  subject 'testing'
  body 'hello'
end
=> #<Mail::Message:0x19284ec ...
Mail::TestMailer.deliveries.length
=> 1
Mail::TestMailer.deliveries.first
=> #<Mail::Message:0x19284ec ...
Mail::TestMailer.deliveries.clear
=> []

There is also a set of RSpec matchers stolen/inspired by Shoulda's ActionMailer matchers (you'll want to set delivery_method as above too):

Mail.defaults do
  delivery_method :test # in practice you'd do this in spec_helper.rb
end

describe "sending an email" do
  include Mail::Matchers

  before(:each) do
    Mail::TestMailer.deliveries.clear

    Mail.deliver do
      to ['mikel@me.com', 'mike2@me.com']
      from 'you@you.com'
      subject 'testing'
      body 'hello'
    end
  end

  it { is_expected.to have_sent_email } # passes if any email at all was sent

  it { is_expected.to have_sent_email.from('you@you.com') }
  it { is_expected.to have_sent_email.to('mike1@me.com') }

  # can specify a list of recipients...
  it { is_expected.to have_sent_email.to(['mike1@me.com', 'mike2@me.com']) }

  # ...or chain recipients together
  it { is_expected.to have_sent_email.to('mike1@me.com').to('mike2@me.com') }

  it { is_expected.to have_sent_email.with_subject('testing') }

  it { is_expected.to have_sent_email.with_body('hello') }

  # Can match subject or body with a regex
  # (or anything that responds_to? :match)

  it { is_expected.to have_sent_email.matching_subject(/test(ing)?/) }
  it { is_expected.to have_sent_email.matching_body(/h(a|e)llo/) }

  # Can chain together modifiers
  # Note that apart from recipients, repeating a modifier overwrites old value.

  it { is_expected.to have_sent_email.from('you@you.com').to('mike1@me.com').matching_body(/hell/)

  # test for attachments

  # ... by specific attachment
  it { is_expected.to have_sent_email.with_attachments(my_attachment) }

  # ... or any attachment
  it { is_expected.to have_sent_email.with_attachments(any_attachment) }

  # ... or attachment with filename
  it { is_expected.to have_sent_email.with_attachments(an_attachment_with_filename('file.txt')) }

  # ... or attachment with mime_type
  it { is_expected.to have_sent_email.with_attachments(an_attachment_with_mime_type('application/pdf')) }

  # ... by array of attachments
  it { is_expected.to have_sent_email.with_attachments([my_attachment1, my_attachment2]) } #note that order is important

  #... by presence
  it { is_expected.to have_sent_email.with_any_attachments }

  #... or by absence
  it { is_expected.to have_sent_email.with_no_attachments }

end

Excerpts from TREC Spam Corpus 2005

The spec fixture files in spec/fixtures/emails/from_trec_2005 are from the 2005 TREC Public Spam Corpus. They remain copyrighted under the terms of that project and license agreement. They are used in this project to verify and describe the development of this email parser implementation.

http://plg.uwaterloo.ca/~gvcormac/treccorpus/

They are used as allowed by 'Permitted Uses, Clause 3':

"Small excerpts of the information may be displayed to others
 or published in a scientific or technical context, solely for
 the purpose of describing the research and development and
 related issues."

 -- http://plg.uwaterloo.ca/~gvcormac/treccorpus/

Author: Mikel
Source Code: https://github.com/mikel/mail 
License: MIT license

#ruby #library #email 

Mail: A Really Ruby Mail Library
Rupert  Beatty

Rupert Beatty

1658084580

Laravel-user-verification: PHP Package Built for Laravel 5.* & 6.*

jrean/laravel-user-verification is a PHP package built for Laravel 5.* & 6.* & 7.* & 8.* & 9.* to easily handle a user verification and validate the e-mail.  

VERSIONS

This package is Laravel 9.0 compliant.

laravel/branch2.23.04.15.06.07.08.09.010.0master
5.0.*x         
5.1.*x         
5.2.*x         
5.3.* x        
5.4.*  x       
5.5.*   x      
5.6.*    x     
5.7.*     x    
5.8.*     x    
6.0.*      x   
7.0.*         x
8.0.*       x x
9.0.*        xx

ABOUT

  •  Generate and store a verification token for a registered user
  •  Send or queue an e-mail with the verification token link
  •  Handle the token verification
  •  Set the user as verified
  •  Relaunch the process anytime

INSTALLATION

This project can be installed via Composer. To get the latest version of Laravel User Verification, add the following line to the require block of your composer.json file:

{
    "require": {
        "jrean/laravel-user-verification": "dev-master"
    }

}

You'll then need to run composer install or composer update to download the package and have the autoloader updated.

Or run the following command:

composer require jrean/laravel-user-verification

Add the Service Provider & Facade/Alias

Once Larvel User Verification is installed, you need to register the service provider in config/app.php. Make sure to add the following line above the RouteServiceProvider.

Jrean\UserVerification\UserVerificationServiceProvider::class,

You may add the following aliases to your config/app.php:

'UserVerification' => Jrean\UserVerification\Facades\UserVerification::class,

Publish the package config file by running the following command:

php artisan vendor:publish --provider="Jrean\UserVerification\UserVerificationServiceProvider" --tag="config"

CONFIGURATION

The model representing the User must implement the authenticatable interface Illuminate\Contracts\Auth\Authenticatable which is the default with the Eloquent User model.

Migration

The table representing the user must be updated with two new columns, verified and verification_token. This update will be performed by the migrations included with this package.

It is mandatory that the two columns are on the same table where the user's e-mail is stored. Please make sure you do not already have those fields on your user table.

To run the migrations from this package use the following command:

php artisan migrate --path="/vendor/jrean/laravel-user-verification/src/resources/migrations"

The package tries to guess your user table by checking what is set in the auth providers users settings. If this key is not found, the default App\User will be used to get the table name.

To customize the migration, publish it with the following command:

php artisan vendor:publish --provider="Jrean\UserVerification\UserVerificationServiceProvider" --tag="migrations"

Middleware

Default middleware

This package provides an optional middleware throwing a UserNotVerifiedException. Please refer to the Laravel Documentation to learn more about how to work with the exception handler.

To register the default middleware add the following lines to the $routeMiddleware array within the app/Http/Kernel.php file:

protected $routeMiddleware = [
    // …
    'isVerified' => \Jrean\UserVerification\Middleware\IsVerified::class,

Apply the middleware on your routes:

Route::group(['middleware' => ['isVerified']], function () {
    // …

Custom middleware

Create your own custom middleware using the following artisan command:

php artisan make:middleware IsVerified

For more details about middlewares, please refer to the Laravel Documentation.

E-MAIL

This package provides a method to send an e-mail with a link containing the verification token.

  • send(AuthenticatableContract $user, $subject, $from = null, $name = null)

By default the package will use the from and name values defined into the config/mail.php file:

    'from' => ['address' => '', 'name' => ''],

If you want to override the values, simply set the $from and (optional) $name parameters.

Refer to the Laravel documentation for the proper e-mail component configuration.

E-mail View

The user will receive an e-mail with a link leading to the getVerification() method (endpoint). The view will receive a $user variable which contains the user details such as the verification token.

The package allow you to use both traditional blade view files and markdown.

By default a sample e-mail view is loaded to get you started with:

Click here to verify your account: <a href="{{ $link = route('email-verification.check', $user->verification_token) . '?email=' . urlencode($user->email) }}">{{ $link }}</a>

If you prefer to use Markdown instead, update the package config file user-verification.php in the config directory and replace the following:

'email' => [
    'type' => 'default',
],

by:

'email' => [
    'type' => 'markdown',
],

If you want to customize the e-mail views, run the following command to publish them and edit them to your needs:

The URL must contain the verification token as parameter + (mandatory) a query string with the user's e-mail as parameter.

php artisan vendor:publish --provider="Jrean\UserVerification\UserVerificationServiceProvider" --tag="views"

The view will be available in the resources/views/vendor/laravel-user-verification/ directory.

ERRORS

This package throws several exceptions. You are free to use try/catch statements or to rely on the Laravel built-in exceptions handler.

  • ModelNotCompliantException

The model instance provided is not compliant with this package. It must implement the authenticatable interface Illuminate\Contracts\Auth\Authenticatable

  • TokenMismatchException

Wrong verification token.

  • UserIsVerifiedException

The given user is already verified.

  • UserNotVerifiedException

The given user is not yet verified.

  • UserNotFoundException

No user found for the given e-mail address.

  • UserHasNoEmailException

User email property is null or empty.

Error View

By default the user-verification.blade.php view will be loaded for the verification error route /email-verification/error. If an error occurs, the user will be redirected to this route and this view will be rendered.

To customize the view, publish it with the following command:

php artisan vendor:publish --provider="Jrean\UserVerification\UserVerificationServiceProvider" --tag="views"

The view will be available in the resources/views/vendor/laravel-user-verification/ directory and can be customized.

USAGE

Routes

By default this packages ships with two routes.

Route::get('email-verification/error', 'Auth\RegisterController@getVerificationError')->name('email-verification.error');
Route::get('email-verification/check/{token}', 'Auth\RegisterController@getVerification')->name('email-verification.check');

Overriding package routes

To define your own custom routes, put the package service provider call before the RouteServiceProvider call in the config/app.php file.

   /*
    * Package Service Providers...
    */
    Jrean\UserVerification\UserVerificationServiceProvider::class,

   /*
    * Application Service Providers...
    */
    // ...
    App\Providers\RouteServiceProvider::class,

Then, add your custom routes in your route file.

Traits

The package offers three (3) traits for a quick implementation. Only VerifiesUsers trait is mandatory and includes RedirectsUsers.

Jrean\UserVerification\Traits\VerifiesUsers

Jrean\UserVerification\Traits\RedirectsUsers

and:

Jrean\UserVerification\Traits\UserVerification

This last one offers two methods that can be added to the User model.

  • isVerified checks if a user is marked as verified.
  • isPendingVerification checks if a verification process has been initiated for a user.

Add the use statement to your User model and use the UserVerification within the class:

Endpoints

The two (2) following methods are included into the VerifiesUsers trait and called by the default package routes.

  • getVerification(Request $request, $token)

Handle the user verification.

  • getVerificationError()

Do something if the verification fails.

API

The package public API offers eight (8) methods.

  • generate(AuthenticatableContract $user)

Generate and save a verification token for the given user.

  • send(AuthenticatableContract $user, $subject = null, $from = null, $name = null)

Send by e-mail a link containing the verification token.

  • sendQueue(AuthenticatableContract $user, $subject = null, $from = null, $name = null)

Queue and send by e-mail a link containing the verification token.

  • sendLater($seconds, AuthenticatableContract $user, $subject = null, $from = null, $name = null)

Send later by e-mail a link containing the verification token.

  • process($email, $token, $userTable)

Process the token verification for the given e-mail and token.

For the sendQueue, sendLater and sendLaterOn methods, you must configure your queues before using this feature.

Facade

The package offers a facade UserVerification::.

Attributes/Properties

To customize the package behaviour and the redirects you can implement and customize six (6) attributes/properties:

  • $redirectIfVerified = '/';

Where to reditect if the authenticated user is already verified.

  • $redirectAfterVerification = '/';

Where to redirect after a successful verification token verification.

  • $redirectIfVerificationFails = '/email-verification/error';

Where to redirect after a failling token verification.

  • $verificationErrorView = 'laravel-user-verification::user-verification';

Name of the view returned by the getVerificationError method.

  • $verificationEmailView = 'laravel-user-verification::email'

Name of the default e-mail view.

  • $userTable = 'users';

Name of the default table used for managing users.

Translations

To customize the translations you may publish the files to your resources/lang/vendor folder using the following command:

php artisan vendor:publish --provider="Jrean\UserVerification\UserVerificationServiceProvider" --tag="translations"

This will add laravel-user-verification/en/user-verification.php to your vendor folder. By creating new language folders, like de or fr and placing a user-verification.php with the translations inside, you can add translations for other languages. You can find out more about localization in the Laravel documentation.

Auto-login

If you wish to automaticaly log in the user after the verification process, update the package config file user-verification.php in the config directory and replace the following:

'auto-login' => false,

by:

'auto-login' => true,

Customize

You can customize the package behaviour by overriding/overwriting the public methods and the attributes/properties. Dig into the source.

GUIDELINES

This package doesn't require the user to be authenticated to perform the verification. You are free to implement any flow you may want to achieve.

This package wishes to let you be creative while offering you a predefined path. The following guidelines assume you have configured Laravel for the package as well as created and migrated the migration according to this documentation and the previous documented steps.

Note that by default the behaviour of Laravel is to return an authenticated user after the registration step.

Example

The following code sample aims to showcase a quick and basic implementation following Laravel logic. You are free to implement the way you want. It is highly recommended to read and to understand the way Laravel implements registration/authentication.

  • Define the e-mail view.

Edit the app\Http\Controllers\Auth\RegisterController.php file.

  •  Import the VerifiesUsers trait (mandatory)
  •  Overwrite and customize the redirect attributes/properties paths available within the RedirectsUsers trait included by the VerifiesUsers trait. (not mandatory)
  •  Overwrite the contructor (not mandatory)
  •  Overwrite the register() method (mandatory)
    namespace App\Http\Controllers\Auth;

    use App\User;
    use App\Http\Controllers\Controller;
    use Illuminate\Support\Facades\Validator;
    use Illuminate\Foundation\Auth\RegistersUsers;

    use Illuminate\Http\Request;
    use Illuminate\Auth\Events\Registered;
    use Jrean\UserVerification\Traits\VerifiesUsers;
    use Jrean\UserVerification\Facades\UserVerification;

    class RegisterController extends Controller
    {
        /*
        |--------------------------------------------------------------------------
        | Register Controller
        |--------------------------------------------------------------------------
        |
        | This controller handles the registration of new users as well as their
        | validation and creation. By default this controller uses a trait to
        | provide this functionality without requiring any additional code.
        |
        */

        use RegistersUsers;

        use VerifiesUsers;

        /**
         * Where to redirect users after registration.
         *
         * @var string
         */
        protected $redirectTo = '/home';

        /**
         * Create a new controller instance.
         *
         * @return void
         */
        public function __construct()
        {
            // Based on the workflow you need, you may update and customize the following lines.

            $this->middleware('guest', ['except' => ['getVerification', 'getVerificationError']]);
        }

        /**
         * Get a validator for an incoming registration request.
         *
         * @param  array  $data
         * @return \Illuminate\Contracts\Validation\Validator
         */
        protected function validator(array $data)
        {
            return Validator::make($data, [
                'name' => 'required|max:255',
                'email' => 'required|email|max:255|unique:users',
                'password' => 'required|min:6|confirmed',
            ]);
        }

        /**
         * Create a new user instance after a valid registration.
         *
         * @param  array  $data
         * @return User
         */
        protected function create(array $data)
        {
            return User::create([
                'name' => $data['name'],
                'email' => $data['email'],
                'password' => bcrypt($data['password']),
            ]);
        }

        /**
         * Handle a registration request for the application.
         *
         * @param  \Illuminate\Http\Request  $request
         * @return \Illuminate\Http\Response
         */
        public function register(Request $request)
        {
            $this->validator($request->all())->validate();

            $user = $this->create($request->all());

            event(new Registered($user));

            $this->guard()->login($user);

            UserVerification::generate($user);

            UserVerification::send($user, 'My Custom E-mail Subject');

            return $this->registered($request, $user)
                            ?: redirect($this->redirectPath());
        }
    }

At this point, after registration, an e-mail is sent to the user. Click the link within the e-mail and the user will be verified against the token.

If you want to perform the verification against an authenticated user you must update the middleware exception to allow getVerification and getVerificationError routes to be accessed.

$this->middleware('guest', ['except' => ['getVerification', 'getVerificationError']]);

RELAUNCH THE PROCESS ANYTIME

If you want to regenerate and resend the verification token, you can do this with the following two lines:

UserVerification::generate($user);
UserVerification::send($user, 'My Custom E-mail Subject');

The generate method will generate a new token for the given user and change the verified column to 0. The send method will send a new e-mail to the user.

LARAVEL SPARK

For Laravel Spark integration, follow this article from Ian Fagg

CONTRIBUTE

Feel free to comment, contribute and help. 1 PR = 1 feature.

Author: jrean
Source Code: https://github.com/jrean/laravel-user-verification 
License: View license

#laravel #php #email 

Laravel-user-verification: PHP Package Built for Laravel 5.* & 6.*
Rupert  Beatty

Rupert Beatty

1657978620

LERN (Laravel Exception Recorder and Notifier)

LERN (Laravel Exception Recorder and Notifier)

LERN from your mistakes

LERN is a Laravel 5 package that will record exceptions into a database and will send you a notification.

Currently supported notification channels via Monolog

Version Compatibility

LaravelLERN
5.1.x3.x
5.2.x3.x
5.3.x3.x
5.4.x3.x
5.5.x4.x
5.6.x4.x
6.x5.x and 6.x
7.x6.x
8.x6.x

Migrating from 3.x to 4.x

Make sure that the config file now includes the new lern.notify.class and lern.record.class settings. Check the config file to see how they are used.

Migrating from 2.x to 3.x

Version 3.x introduces the ability to collect more information from the error such as the user_id, url, method, and input data. In order to use 3.x you will need to copy over the new config file, the migration file and then migrate it.

# This will only copy over the migration file. For the config file you can either include the --force flag (Which will overwrite it) or copy it manually from github
php artisan vendor:publish --provider="Tylercd100\LERN\LERNServiceProvider"
php artisan migrate

Installation

Version 4.x uses Package Discovery. If you are using 3.x you will need to follow these instructions.

Install via composer - In the terminal:

composer require tylercd100/lern

Then you will need to run these commands in the terminal in order to copy the config and migration files

php artisan vendor:publish --provider="Tylercd100\LERN\LERNServiceProvider"

Before you run the migration you may want to take a look at config/lern.php and change the table property to a table name that you would like to use. After that run the migration

php artisan migrate

Usage

To use LERN modify the report method in the app/Exceptions/Handler.php file

public function report(Throwable $e)
{
    if ($this->shouldReport($e)) {

        //Check to see if LERN is installed otherwise you will not get an exception.
        if (app()->bound("lern")) {
            app()->make("lern")->handle($e); //Record and Notify the Exception

            /*
            OR...
            app()->make("lern")->record($e); //Record the Exception to the database
            app()->make("lern")->notify($e); //Notify the Exception
            */
        }
    }

    return parent::report($e);
}

Dont forget to add this to the top of the file

//If you updated your aliases array in "config/app.php"
use LERN;
use Throwable;
//or if you didnt...
use Tylercd100\LERN\Facades\LERN;
use Throwable;

Recording

You can call LERN::record($exception); to record an Exception to the database. To query any Exception that has been recorded you can use ExceptionModel which is an Eloquent Model

use Tylercd100\LERN\Models\ExceptionModel;
$mostRecentException = ExceptionModel::orderBy('created_at','DESC')->first();

To change what is recorded in to the database take a look at config/lern.php

'record'=>[
    /**
     * The Model to use
     */
    'model' => \Tylercd100\LERN\Models\ExceptionModel::class,

    /**
     * Database connection to use. Null is the default connection.
     */
    'connection'=>null,

    /**
     * Database table to use
     */
    'table'=>'vendor_tylercd100_lern_exceptions',

    /**
     * Information to store
     */
    'collect'=>[
        'method'=>false, //When true it will collect GET, POST, DELETE, PUT, etc...
        'data'=>false, //When true it will collect Input data
        'status_code'=>true,
        'user_id'=>false,
        'url'=>false,
        'ip'=>false,
    ],
],

Note: If you change lern.recorder.model then lern.recorder.table and lern.recorder.connection will be ignored unless you extend \Tylercd100\LERN\Models\ExceptionModel::class

Notifications

LERN uses the Monolog library to send notifications. If you need more than the supported notification channels, then you can add your own custom Monolog handlers. To start using any of the supported handlers just edit the provided config file config/lern.php.

Changing the log level programmatically

Some notification services support different log levels. If changing the config value lern.notify.log_level is not enough then try it this way:

// Change the log level.
// Default is: critical
// Options are: debug, info, notice, warning, error, critical, alert, emergency
LERN::setLogLevel("emergency");

Changing the subject line

Some notification services support a subject line, this is how you change it.

//Change the subject
LERN::setSubject("An Exception was thrown!");

Changing the body of the notification

LERN publishes a default blade template file that you can find at resources/views/exceptions/default.blade.php. The blade template file is compiled with these values: $exception $url $method $data $user. To specify a different blade template file, just edit the config file

'notify'=>[
    'view'=>'exceptions.default',
],

(deprecated) Using the LERN::setMessage() function

Make sure that you set the view config value to null or the LERN::setMessage() will not work

'notify'=>[
    'view'=>null,
],

Custom Monolog Handlers

To use a custom Monolog Handler call the pushHandler method

use Monolog\Handler\SlackHandler;
$handler = new SlackHandler($token, $channel);
LERN::pushHandler($handler);
LERN::notify($exception);

Further Reading and How-Tos

Roadmap

  • Support more Monolog Handlers
  • Exception report page or command to easily identify your application's issues.

Author: tylercd100
Source Code: https://github.com/tylercd100/lern 
License: MIT license

#laravel #email #database #notification 

LERN (Laravel Exception Recorder and Notifier)
Nat  Grady

Nat Grady

1657942860

A Beautiful, Fast & Fully Open Source Mail Client for Mac, Windows

💌 Mailspring

Mailspring is a new version of Nylas Mail maintained by one of the original authors. It's faster, leaner, and shipping today! It replaces the JavaScript sync code in Nylas Mail with a new C++ sync engine based on Mailcore2. It uses roughly half the RAM and CPU of Nylas Mail and idles with almost zero "CPU Wakes", which translates to great battery life. It also has an entirely revamped composer and other great new features.

Mailspring's UI is open source (GPLv3) and written in TypeScript with Electron and React - it's built on a plugin architecture and was designed to be easy to extend. Check out CONTRIBUTING.md to get started!

Mailspring's sync engine is spawned by the Electron application and runs locally on your computer. It is open source (GPLv3) and written in C++ and C. For convenience, however, when you set up your development environment, Mailspring uses the latest version of the sync engine we've shipped for your platform so you don't need to pull sources or install its compile-time dependencies.

Mailspring Screenshot

Features

Mailspring comes packed with powerful features like Unified Inbox, Snooze, Send Later, Mail Rules, Templates and more. Mailspring Pro, which you can unlock with a monthly subscription, adds even more features for people who send a ton of email: link tracking, read receipts, mailbox analytics, contact and company profiles. All of these features run in the client - Mailspring does not send your email credentials to the cloud. For a full list of features, check out getmailspring.com.

Download Mailspring

You can download compiled versions of Mailspring for Windows, Mac OS X, and Linux (deb, rpm and snap) from https://getmailspring.com/download.

Getting Help

You can find community-based help and discussion with other Mailspring users on our Discourse community.

Contributing

Mailspring is entirely open-source. Pull requests and contributions are welcome! There are three ways to contribute: building a plugin, building a theme, and submitting pull requests to the project itself. When you're getting started, you may want to join our Discourse so you can ask questions and learn from other people doing development.

Contributor Covenant

Running Mailspring from Source

To install all dependencies and run Mailspring from its source code, run the following commands from the root directory of the Mailspring repository:

export npm_config_arch=x64 # If you are on an M1 / Apple Silicon Mac
npm install
npm start

You can attach command line parameters by separating them using a double hyphen:

npm start -- --help

Building Mailspring

To build Mailspring, you need to run the following command from the root directory of the Mailspring repository:

npm run-script build

Building A Plugin

Plugins lie at the heart of Mailspring and give it its powerful features. Building your own plugins allows you to integrate the app with other tools, experiment with new workflows, and more. Follow the Getting Started guide to write your first plugin in five minutes.

To create your own theme, check out the Mailspring-Theme-Starter.

To create your own plugin, check out the Mailspring-Plugin-Starter.

A plugin "store" like the Chrome Web Store is coming soon, and will make it easy for other users to discover plugins you create. (Right now, users need to "sideload" the plugins into the app by downloading them and copying them into place.)

You can share and browse Mailspring Plugins, and discuss plugin development with other developers, on our Discourse.

Building a Theme

The Mailspring user interface is styled using CSS, which means it's easy to modify and extend. Mailspring comes stock with a few beautiful themes, and there are many more which have been built by community developers. To start creating a theme, clone the theme starter!

If you are updating an existing Nylas theme for Mailspring here is a step by step tutorial. Notice: as part of the update process you will probably need to import mailspring base variables.

You can share and browse Mailspring Themes, and discuss theme development with other developers, on our Discourse.

Localizing / Translating

Mailspring (1.5.0 and above) supports localization. If you're a fluent speaker of another language, we'd love your help improving translations. Check out the LOCALIZATION guide for more information. You can discuss localization and translation with other developers on our Discourse.

Contributing to Mailspring Core

Pull requests are always welcome - check out CONTRIBUTING for more information about setting up the development environment, running tests locally, and submitting pull requests.

Author: Foundry376
Source Code: https://github.com/Foundry376/Mailspring 
License: GPL-3.0 license

#electron #windows #linux #email 

A Beautiful, Fast & Fully Open Source Mail Client for Mac, Windows
Mike  Kozey

Mike Kozey

1657626360

Tomba-io/dart: Official Dart Library for Tomba Email Finder

Tomba Email Finder Dart Client Library

This is the official Dart client library for the Tomba.io Email Finder API, allowing you to:

  • Domain Search. (Search emails are based on the website You give one domain name and it returns all the email addresses found on the internet.)
  • Email Finder (This API endpoint generates or retrieves the most likely email address from a domain name, a first name and a last name..)
  • Email Verifier. (checks the deliverability of a given email address, verifies if it has been found in our database, and returns their sources.)
  • Email Sources (Find email address source somewhere on the web .)
  • Company Domain autocomplete (Company Autocomplete is an API that lets you auto-complete company names and retrieve logo and domain information.)

Getting Started

You'll need an Tomba API access token, which you can get by signing up for a free account at https://app.tomba.io/auth/register

The free plan is limited to 25 search request and 50 verification a month, To enable all the data fields and additional request volumes see https://tomba.io/pricing.

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  tomba: ^v1.0.0

You can install packages from the command line With Dart:

dart pub add tomba

Usage

Domain Search

get email addresses found on the internet.

import 'package:tomba/tomba.dart';

void main() { 
  // Init SDK
  Client client = Client();
  Domain domain = Domain(client);

  client
   .setKey("ta_xxxx") // Your Key
   .setSecret("ts_xxxx"); // Your Secret
  ;

  Future result = domain.domainSearch(
    domain: 'stripe.com',
  );

  result
    .then((response) {
      print(response);
    }).catchError((error) {
      print(error.response);
  });
}

Email Finder

Find the verified email address of any professional.

import 'package:tomba/tomba.dart';

void main() { 
  // Init SDK
  Client client = Client();
  Finder finder = Finder(client);

  client
   .setKey("ta_xxxx") // Your Key
   .setSecret("ts_xxxx"); // Your Secret
  ;

  Future result = finder.emailFinder(
    domain: 'stripe.com',
    firstName: 'Fname',
    lastName: 'Lname',
  );

  result
    .then((response) {
      print(response);
    }).catchError((error) {
      print(error.response);
  });
}

Email Verifier

Verify the validity of any professional email address with the most complete email checker.

import 'package:tomba/tomba.dart';

void main() { 
  // Init SDK
  Client client = Client();
  Verifier verifier = Verifier(client);

  client
   .setKey("ta_xxxx") // Your Key
   .setSecret("ts_xxxx"); // Your Secret
  ;

  Future result = verifier.emailVerifier(
    email: 'b.mohamed@tomba.io',
  );

  result
    .then((response) {
      print(response);
    }).catchError((error) {
      print(error.response);
  });
}

Examples

Sample codes under examples/ folder.

Installing

Use this package as a library

Depend on it

Run this command:

With Dart:

 $ dart pub add tomba

With Flutter:

 $ flutter pub add tomba

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):

dependencies:
  tomba: ^1.0.0

Alternatively, your editor might support dart pub get or flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:tomba/tomba.dart';

example/README.md

tomba_example

Demonstrates how to use the tomba plugin.

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Documentation

See the official documentation.

Other Libraries

There are official Tomba Email Finder client libraries available for many languages including PHP, Python, Go, Java, Ruby, and many popular frameworks such as Django, Rails and Laravel. There are also many third party libraries and integrations available for our API.

https://developer.tomba.io/#introduction-libraries

About Tomba

Founded in 2020, Tomba prides itself on being the most reliable, accurate, and in-depth source of Email address data available anywhere. We process terabytes of data to produce our Email finder API, company.

Contribution

  1. Fork it (https://github.com/tomba-io/dart/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Author: Tomba-io
Source Code: https://github.com/tomba-io/dart 
License: View license

#flutter #dart #email 

Tomba-io/dart: Official Dart Library for Tomba Email Finder