package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://app-x.nipamail.com/v1.0/transactional/post?accept_token=NPAPP-IGBmfucf0Np567WzwAH1KuRovnszt9r4HJPJ2U4SRhPk1pCeBXEi7nUkixLby8qwwwymbXwtV3gjOMeodNKlcAChYrZ0D8TQv60208fxXIZlJ7www" payload := strings.NewReader("------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"from_name\"\r\n\r\nThaksinai Kondee\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"from_email\"\r\n\r\nthaksinai@hotmail.com\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"to\"\r\n\r\nthaksinai@ispio.com\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"subject\"\r\n\r\nร่วมฉลอง ครบรอบการก่อตั้ง บริษัท Nipa technology วันนี้ เวลา 18:00 น.\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\ncontent1\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"reply_email\"\r\n\r\nse55660159@gmail.com\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"reply_name\"\r\n\r\nThakweb.com\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW") req.Header.Add("cache-control", "no-cache") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }