Skip to main content

account.sendVerifyEmailCode

Send an email verification code.

func (c *Client) AccountSendVerifyEmailCode(ctx context.Context, request *AccountSendVerifyEmailCodeRequest) (*AccountSentEmailCode, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.AccountSendVerifyEmailCode(ctx, &tg.AccountSendVerifyEmailCodeRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *AccountSentEmailCode
return nil
})

Parameters

NameTypeRequiredDescription
PurposeEmailVerifyPurposeClassyesVerification purpose.
EmailstringyesThe email where to send the code.

Returns

*AccountSentEmailCode

Possible errors

CodeTypeDescription
400EMAIL_INVALIDThe specified email is invalid.
400EMAIL_NOT_ALLOWEDThe specified email cannot be used to complete the operation.
400EMAIL_NOT_SETUPIn order to change the login email with emailVerifyPurposeLoginChange, an existing login email must already be set using emailVerifyPurposeLoginSetup.
400PHONE_CODE_EMPTYphone_code is missing.
400PHONE_HASH_EXPIREDAn invalid or expired phone_code_hash was provided.
400PHONE_NUMBER_INVALIDThe phone number is invalid.

References