// IsEmail validates that a string is a email.
342531
func IsEmail(field, email string) []ValidationMsg {
	if emailRegex.MatchString(email) {
		return []ValidationMsg{}
	}

	return []ValidationMsg{ValidationMsg{Field: field, Msg: NotEmailMsg}}
}
766018
func (repo *repo) FindByEmail(email string) (user service.Entity, err error) {
	if err = dbconn.DB.Where("email = ?", email).First(&user).Error; err != nil {
		return service.Entity{}, err
	}
	return user, nil
}
566936
func UserFilterByEmail(email string) func(db *gorm.DB) *gorm.DB {
	return func(db *gorm.DB) *gorm.DB {
		return db.Where("email = ?", email)
	}
}
602715
func (s *UserInfo) SetEmail(v string) *UserInfo {
	s.Email = &v
	return s
}
1303184
func (m *UserManager) GetByEmail(email string) (user User, err error) {
	stmt := Users.Select().Where(Users.C("email").Equals(email))
	if err = m.conn.Query(stmt, &user); err != nil {
		return
	}
	if !user.Exists() {
		err = fmt.Errorf("auth: no user with email %s exists", email)
	}
	return
}
698661
func (s *Resource) SetEmail(v string) *Resource {
	s.Email = &v
	return s
}
336462
func (s *UpdateUserInput) SetEmail(v string) *UpdateUserInput {
	s.Email = &v
	return s
}
1253956
func (this *Request) Is(t string) bool {
	h := this.Get("Content-Type")
	return strings.ToLower(h) == strings.ToLower(t)
}
1290232
func SendEmail(toPersons []string, subject string, mailTemplate string, data map[string]interface{}) error {
	log.Info("will send mail...")

	m := gomail.NewMessage()
	m.SetHeader("From", "notice@uke.email")
	m.SetHeader("To", toPersons...)
	m.SetHeader("Subject", subject)

	d := gomail.NewDialer(SMTP, Port, Sender, Password)
	tmpl, err := tmpl.Parse(mailTemplate)
	if err != nil {
		return err
	}

	var contents bytes.Buffer
	if err = tmpl.Execute(&contents, data); err != nil {
		return err
	}

	m.SetBody("text/html", contents.String())

	return d.DialAndSend(m)
}
1094665
def is_email(string):
    
    email_regex = r'^[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*$'

    if isinstance(string, str) and not re.match(email_regex, string):
        return False
    else:
        return True
536482
func (db *DynamoDB) GetByEmail(email string) (u *models.User, ok bool) {
	res, err := db.DB.Query(&dynamodb.QueryInput{
		// ConsistentRead: aws.Bool(true),
		TableName:              aws.String("users"),
		IndexName:              aws.String("Email"),
		Select:                 aws.String("ALL_ATTRIBUTES"),
		KeyConditionExpression: aws.String("Email = :Email"),
		ExpressionAttributeValues: map[string]*dynamodb.AttributeValue{
			":Email": {
				S: aws.String(email),
			},
		},
	})
	if err != nil {
		log.Printf("dynamodb: getbymail error: %v", err)
		return nil, false
	}

	var user models.User
	if err := dynamodbattribute.UnmarshalMap(res.Items[0], &user); err != nil {
		log.Printf("dynamodb: getbyid error: %v", err)
		return nil, false
	}

	return &user, true
}
566537
func (s *CreateAccountInput) SetEmail(v string) *CreateAccountInput {
	s.Email = &v
	return s
}
526433
func (s *DeleteFileInput) SetEmail(v string) *DeleteFileInput {
	s.Email = &v
	return s
}
1011455
func SendEmail(config cfg.Config, subject, body string, tos []string) error {
	email := Compose(subject, body)
	email.From = config.GetString("smtp_user")
	email.ContentType = "text/html; charset=utf-8"
	email.AddRecipients(tos...)
	err := email.Send(config)
	return err
}
1116072
func (s Service) SendEmail(from string, to []string, subject string, body string) error {
	return s.SendEmailWithHeaders(from, to, subject, body, nil)
}
984964
func Email() string {
	return strings.ToLower(FirstName(RandomGender)+LastName()) + StringNumberExt(1, "", 3) + "@" + randomFrom(jsonData.Domains)
}
1115107
func validateEmail(address string) error {
	email, err := mail.ParseAddress(address)
	if err != nil {
		return unparseableEmailError
	}
	splitEmail := strings.SplitN(email.Address, "@", -1)
	domain := strings.ToLower(splitEmail[len(splitEmail)-1])
	if forbiddenMailDomains[domain] {
		return berrors.InvalidEmailError(
			"invalid contact domain. Contact emails @%s are forbidden",
			domain)
	}
	if _, err := iana.ExtractSuffix(domain); err != nil {
		return berrors.InvalidEmailError("email domain name does not end in a IANA suffix")
	}
	return nil
}