这是我想要发送到我的电子邮件地址的数据。我如何实现一种方法来实现这一点?
{Name: "John", phoneNumber: "12364597"}
Name: "John"
phoneNumber: "12364597"
__proto__: Object
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent {
submit(f) {
console.log(f.value);
}
constructor() { }
}
使用mailto
submit(f) {
window.location.href = `mailto:mail@example.org?subject=look at this website&body=Hello Iam ${f.value.name} and here is my phone no. ${f.value.phoneNumber}`;
}
或者从后端发送邮件或使用外部包