aerc/commands/compose/send-message.go

30 lines
499 B
Go
Raw Normal View History

package compose
import (
"errors"
"os"
"git.sr.ht/~sircmpwn/aerc2/widgets"
)
func init() {
register("send-message", SendMessage)
}
func SendMessage(aerc *widgets.Aerc, args []string) error {
if len(args) > 1 {
return errors.New("Usage: send-message")
}
composer, _ := aerc.SelectedTab().(*widgets.Composer)
//config := composer.Config()
f, err := os.Create("/tmp/test.eml")
if err != nil {
panic(err)
}
_, err = composer.Message(f)
if err != nil {
panic(err)
}
return nil
}